package cn.itcast.fuxi;
public class Changeableargs {
/**
* @param args
*/
public static void main(String[] args) {
//参数类型是String,为什么传入String数组也能被调用,不会报参数不匹配异常呢?
test2(new String[]{"23","23","we"});
}
public static void test2(String... strArray) {
if(strArray!=null && strArray.length>0){
for(String str : strArray){
System.out.print(str + "\t");
}
}
}
} |