publicclassMethodArgsTest{publicstaticvoidmain(String[] args){
MethodArgsTest test =newMethodArgsTest();
test.show(12);//1// test.show("hello");//2// test.show("hello","world");//3// test.show();//3
test.show(newString[]{"AA","BB","CC"});//3}//1publicvoidshow(int i){}//2publicvoidshow(String s){
System.out.println("show(String)");}//3publicvoidshow(String ... strs){
System.out.println("show(String ... strs)");for(int i =0;i < strs.length;i++){
System.out.println(strs[i]);}}//不能与上一个方法public void show(String ... strs)同时存在// public void show(String[] strs){// // }//The variable argument type String of the method //show must be the last parameter// public void show(String ...strs,int i){// // }(这种方法定义是错误的error)}