Given:
public class Main { Main() { main("hi"); } public static void main(String[] args) { System.out.print("2 "); } /* w ww . ja v a 2 s . c o m*/ public static void main(String args) { System.out.print("3 " + args); } }
What is the result?
Choose all that apply.
A is correct.
It's legal to overload main()
.
Since no instances of Main are created, the constructor does not run and the overloaded version of main()
does not run.
B, C, D, and E are incorrect based on the preceding.