0

Is it necessary that main method is always static

why

12th Mar 2017, 1:45 PM
shamoil
3 Réponses
+ 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.
12th Mar 2017, 1:51 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
0
yes)
12th Mar 2017, 1:47 PM
Ihor
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.
12th Mar 2017, 2:42 PM
Lakshmi Sowndarya Kota
Lakshmi Sowndarya Kota - avatar