WHY JAVA MAIN METHOD IS STATIC?

Samuel Fernandes

Total Post:38

Points:190
Posted by  Samuel Fernandes
Java 
 699  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.

      Modified On Mar-27-2018 07:03:46 AM

Answer

NEWSLETTER

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