+ 2

Can a java program can run without main() method?

18th Jun 2017, 10:48 PM
sandeep kaur
2 ответов
+ 3
No, you can't run a java program without main() In java 6 and earlier, you can use Static Blocks ( http://docs.oracle.com/javase/tutorial/java/javaOO/initial.html ), but there isn't a practical reason to do that.
18th Jun 2017, 11:34 PM
⏩▶Clau◀⏪
⏩▶Clau◀⏪ - avatar
0
No because the main method serves as the starting point of a program's execution.
19th Jun 2017, 9:34 PM
Seth Moga
Seth Moga - avatar