Answers for "why does the main method have to be static"

2

why main method static

Because the object is not required to call the static method. 
If we make the main method non-static, 
JVM will have to create its object first and then call main() method which 
will lead to the extra memory allocation.
Posted by: Guest on November-28-2020

Code answers related to "why does the main method have to be static"

Browse Popular Code Answers by Language