7. Why main method is static method ?

 

Because the main method is entry point of whole application.
JVM have to execute main() method to start application

–> it needs to be loaded into main memory first so that JVM can be find it and execute

And because the static method will be loaded into main memory by class loader before application running

–> main method is static method

Leave a Reply

Your email address will not be published. Required fields are marked *