What do the 3 dots following String
in the following method mean?
public void myMethod(String... strings){
// method body
}
Example 1:
public class quest1 {
public quest1(String... mynum) {
System.out.println("yee haa");
}
public static void main(String[] args) {
quest1 q=new quest1();
quest1 q1=new quest1("hello");
}
}
Example 2:
public class quest1 {
public quest1(int... at) {
System.out.println("yee haa");
}
public quest1(String... at) {
System.out.println("yee haa");
}
public static void main(String[] args) {
quest1 q=new quest1("value");
quest1 q1=new quest1(1);
}
public void name(String ... s) {
}
}
output:
yee haa
yee haa