CodesJava

Easy learning with example program codes

why main() method must be static?


JVM invokes main method even before the instantiation of the class. As non-static members or methods cannot be called with the class name directly so main() method should be declared as static.

Java interview questions on main method



Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap