DEVFYI - Developer Resource - FYI

485. Can I have multiple main methods in the same class?

Java Interview Questions and Answers (part 3)


(Continued from previous question...)

485. Can I have multiple main methods in the same class?

No the program fails to compile. The compiler says that the main method is already defined in the class.

(Continued on next question...)

Other Interview Questions