public class MethodParameter {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println(getString(10,20));
System.out.println(getString(10,20,"Hello"));
System.out.println(getString(10,20,"Hello","World"));
String [] sa = {"Hello","World"};
System.out.println(getString(10,20,sa));
}
//...c帶入 string
static String getString(int a,int b,String ...c){
String toReturn = ""+a+","+b;
for(String s : c)
toReturn+=","+s;
return toReturn;
}
}