首页 > 代码库 > jdk新特性——可变参数

jdk新特性——可变参数

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]+"!");    }}