Home > DeveloperSection > Interviews > why java main method is static?

Posted on    March-27-2015 12:07 AM

 Java Java 
Ratings:
 2 Answer(s)
  428  View(s)
Rate this:

Samuel Fernandes
Samuel Fernandes

Total Post:28

Points:140
Posted on    March-27-2015 12:07 AM



Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    March-27-2015 1:28 AM

 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.

Don't want to miss updates? Please click the below button!

Follow MindStick