Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
每次我尝试运行一个程序时,
错误:在类 program3 中找不到主方法,请将主方法定义为:
public static void main(String[] args)
一个例子是:
public class program3 { public static void main(String[] args) { System.out.println("Hello World"); } }
任何帮助表示赞赏,在此先感谢。
选择特定文件并右键单击。现在您可以看到运行选项。尝试这个
确保您正在编译课程。如果您没有编译代码并尝试执行在插入 main 之前编译的旧版本可能会导致问题。