Why Java has main method?

Reasons for defining main() method as static The main() method is the entry point of each and every Java program. The main() method is required because the compiler starts executing a program from this entry point . The JVM needs to instantiate the class if the main() method is allowed to be non-static.

Sizin İçin Seçtik  What is meant by method in Java?

Leave a Reply

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