public class Demo04 {
public static void main(String[] args) {
Demo04 demo04 = new Demo04();
demo04.test(1,2,3);
}
public void method(int a,int b){
}
public static void test(int... i){
System.out.println(i[0]);
System.out.println(i[1]);
System.out.println(i[2]);
}
}
int...i参数必须放在方法传参的最后面!!!