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

Please follow and like us:
Content Protection by DMCA.com