why java main method is static (JNNC Technologies)

                                                         https://jnnctechnologies.com/

Java program's main method has to be declared static because keyword static allows main to be called without creating an object of the class in which the main method is defined. ... In this case, main must be declared as public , since it must be called by code outside of its class when the program is started.



0 Comments

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();