Why doesn't the main method run?

后端 未结 3 1060

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         


        
3条回答
  •  一个人的身影
    2021-01-26 16:26

    Your application has one entry point, and that entry point is the single main method that gets executed. If your entry point is the theGame class, only the main method of that class will be executed (unless you manually execute main methods of other classes).

    Creating an instance of lineTest class doesn't cause its main method to be executed.

提交回复
热议问题