0

Can we execute a program without main() in JAVA ?

18th Mar 2018, 7:50 PM
Wasim Abbasi
Wasim Abbasi - avatar
4 ответов
+ 7
Yes You can compile and execute without main method By using static block. But after static block executed (printed) you will get an error saying no main method found. ... But this will not execute with JAVA 7 version.
18th Mar 2018, 7:51 PM
Baraa AB
Baraa AB - avatar
+ 3
welcome bro.. and good luck <3
18th Mar 2018, 7:58 PM
Baraa AB
Baraa AB - avatar
+ 1
thanks.💙
18th Mar 2018, 7:53 PM
Wasim Abbasi
Wasim Abbasi - avatar