多参数测试
输出结果
源码
public class VarargsTest {
void varargs(Object... args){
for (int i = 0; i <args.length ; i++) {
System.out.println(args[i]);
}
}
@Test
public void testVar(){
Map<String,String> map=new ConcurrentHashMap<String, String>();
map.put("111","adas");
varargs("11", "222", null,map);
}
}
时间: 2024-10-16 01:54:57