且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么 NetBeans 找不到我的主类?

更新时间:2022-06-21 06:38:18

你的 main 方法应该是 static

Your main method should be static

public static void main(String[] ar)

当JVM调用主类时,它不会创建类的实例,它只是加载类并调用static main()方法

When JVM invokes main class it doesn't create instance of the class, it just loads the class and invokes static main() method