WHY JAVA MAIN METHOD IS STATIC?

Samuel Fernandes

Total Post:38

Points:190
Posted by  Samuel Fernandes
Java 
 602  View(s)
Ratings:
Rate this:
  1. Samuel Fernandes

    Post:38

    Points:190
    why java main method is static?


  1. Mayank Tripathi

    Post:807

    Points:4035
    why java main method is static?

     because object is not required to call static method if it were non-static method, jvm create object first then call main() method that will lead the problem of extra memory allocation.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!