package com.test;
public class Variable {
/**
* @param args
*/
public static void Test1(int[] agrs) {
for (int i = 1; i < agrs.length; i++) {
System.out.println(agrs[i]);
}
}
public static void TestVariable(int... agrs) {
for (int i = 0; i < agrs.length; i++) {
System.out.println(agrs[i]);
}
}
public static void main(String[] args) {
TestVariable(1,2,3); //也可以不传参。
// this 还真不能使用this
Test1(new int[] { 1, 2 });//必须传参
}
}