Why is Main in a class Java?

In any Java program, the main() method is the starting point from where compiler starts program execution . So, the compiler needs to call the main() method. If the main() is allowed to be non-static, then while calling the main() method JVM has to instantiate its class.

Sizin İçin Seçtik  What is a main () in Java?

Leave a Reply

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