DEVFYI - Developer Resource - FYI

What if the main method is declared as private?

Java Interview Questions and Answers (part 3)


(Continued from previous question...)

476. What if the main method is declared as private?

The program compiles properly but at runtime it will give "Main method not public." message.

(Continued on next question...)

Other Interview Questions