0
Is it necessary that main method is always static
why
3 Answers
+ 1
Yes, it is mandatory as main method is the place where programmer lay done execution order in which and how the program shall behave otherwise member functions are binded to/called from the instantiated objects only.
0
yes)
0
yes, static methods are the only methods which are directly called with the class name without using the class instance and static methods are the loaded only once. when the <classname>.java file is compiled without errors it will give a <classname>.class file. In turn the <classname>.class file converts into <classname>.main which is a static method. As i already mentioned static methods are directly called with class name.