2.1 The format of the variable number of formal parameters: data type...variable name
2.2 When calling a method with a variable number of formal parameters, the number of actual parameters passed in can be zero, one or more than one
2.3 The method of a variable number of formal parameters has the same name as the method in this class, and methods with different formal parameters constitute an overload
2.4 The method of the variable number of formal parameters has the same name as the method in this class, and the arrays with the same formal parameter type do not constitute overloading.
2.5 The variable number of formal parameters must be declared at the end of the method
2.6 Variable number of formal parameters In the formal parameters of a method, at most one deformable parameter can be declared
publicstaticvoidmain(String[] args){
MethodArgsTest test=newMethodArgsTest();
test.show("可能我浪荡,让人家不安","说谎");
test.show(1,"可能我浪荡,让人家不安","说谎");}publicvoidshow(String... str){
System.out.println(Arrays.toString(str));for(int i =0; i < str.length; i++){
System.out.println(str[i]);}}publicvoidshow(int a,String... str){
System.out.println(Arrays.toString(str));for(int i =0; i < str.length; i++){
System.out.println(str[i]);
System.out.println(a);}}