public class T12 {
public void ss(Object... list){
for(Object o:list){
System.out.println(o);
}
}
public void ss(int i1,int i2,int i3){
System.out.println("111");
}
public void ss(int i1,Object...list){
System.out.println("222");
for(Object o:list){
System.out.println(o);
}
}
public static void main(String[] args) {
T12 t12 = new T12();
t12.ss(1,2,3); //会输出111
t12.ss(1,2,3,4); //会报错
}
}
标签:JAVA,ss,void,System,int,可变,public,歧义,out
From: https://www.cnblogs.com/sjj123/p/16841833.html