Java only allowing global variables to be static?

后端 未结 5 541
难免孤独
难免孤独 2021-01-19 01:40

So I just started coding a Java program I\'m writing and it\'s telling me that my global variables need to be static. I don\'t understand why it\'s telling me this because I

5条回答
  •  长发绾君心
    2021-01-19 02:33

    It is complaining becos the main method is static and you trying to access it directly. If you create a an instance of your class PlannerMain you can access without any problem.

提交回复
热议问题