public class array2{ public static void main(String[] args) { sayHello("beijing","xian"); } private static void sayHello(String ... args) { for (int i = 0; i < args.length; i++) System.out.println("hello," + args[i]+"!"); } }
原文:http://www.cnblogs.com/xjtumj/p/3918629.html