How to pass values in an array to variable parameters

public void print(Object, String ... args){
    for(int i = 0 ; i < args.length; iPP){
        println(args[i]);
    }
}

/ / now there is an array String [] p1 = {"Xiaoming", "Xiao Hong", "Xiaohua"}
/ / String [] p2 = {"Xiaomi", "Samsung", "Huawei", "Apple"}

how to call print, to output the array? currently, only variable parameters are considered, not directly passing parameters.

actually I want to write a general method to get the constructor
Constructor constructor = c.getConstructor (); / / I don"t know how to write the parameters of this method


actually directly

print(p1);

can

Menu