java String...param (3点参数使用 )

public static void test3pointparam(String... param) {
		for(String r: param){
			System.out.println(r);
		}
		String result = param[0] ;
		System.out.println(result);
	}
	public static void main(String[] args) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
		
		test3pointparam("1","21");
	}
		



输出结果


1
21
1

你可能感兴趣的:(j2se)