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

Content Protection by DMCA.com
Please Share