java 1.5以后增加了函数多参数这一特性
public class Test {
public static void main(String[] args) {
new Test().mutliFunction(2, "a","b","c");
}
//
public void mutliFunction(int a , String ... args){
for (String s : args) {
System.out.println(s);
}
}
}
如下,在函数声明中中加入 ... 即可表示多参数