2019.9.9 main method in java Why not call a non-static method

Issues such as the title

Figure

Arrow part is wrong

The reason: Because the main method is a static method static, we can only call the static method,

The solution: the method into a new class, and then the main method instance, then again by calling this class

      Alternatively, the method is set to static

Guess you like

Origin www.cnblogs.com/WildSky/p/11488230.html