+ 2

In java, can we execute our program without main() method? What do you say YES or NO?

Java quizzes

23rd Jun 2018, 6:36 AM
Nilesh Shinde
Nilesh Shinde - avatar
2 Réponses
+ 2
We can. check this... abstract static Example extends javafx.application.Application{ static{ System.out.println("Hello world without main()"); System.exit(0); } }
23rd Jun 2018, 6:44 AM
Nilesh Shinde
Nilesh Shinde - avatar