0

Is it possible to run program without main method?

7th Aug 2017, 6:30 PM
Adil Khan
Adil Khan - avatar
3 odpowiedzi
+ 4
No. Before Java 7 you could use the static block to execute code without the main method. Since it runs before main is called, when the class is loaded. But this is no longer allowed.
7th Aug 2017, 6:47 PM
Rrestoring faith
Rrestoring faith - avatar
0
thanks
8th Aug 2017, 4:21 PM
Adil Khan
Adil Khan - avatar