Possible Duplicate:
Can we overload the main method in Java?
When I tryed to compile and run following code, it's working and I see "A" on the console.
Why?
In my mind (String... args) it is the same (String arg, String[] args).
public class AFewMainExample {
public static void main(String... args) {
System.out.print("A");
}
public static void main(String args) {
System.out.print("B");
}
public static void main(String[] args, String arg) {
System.out.print("C");
}
public static void main(String arg, String[] args) {
System.out.print("D");
}
}