A bit confused about the public static void main method in Java and was hoping someone could help. I have two classes
public class theGame {
public s
When a java application is executed, it is executed by invoking the main method on one particular class. This main method will be whichever main method is on the class that was selected to executed.
In your case, you are selecting to execute the main method on the class theGame
.
When another class is constructed in the application, the constructor of that class is automatically executed, but the main method on that class is not automatically executed.