0 votes
Why do we write public static void main?

1 Answer

0 votes
The main method must be public so it can be found by the JVM when the class is loaded. Similarly, it must be static so that it can be called after loading the class, without having to create an instance of it. All methods must have a return type, which in this case is void.
Welcome to our site: Practicing the fine art of women supporting women