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.
java博士编译我的代码很好,但是,它根本不运行它们,它只打印“静态错误:这个类没有接受String []的静态void main方法。” . 我在 Windows 上尝试了确切的代码,它运行良好。我不知道问题出在哪里。是我的 Mac、我的代码还是 Dr java?
我希望我能提供正在发生的事情的图像。看来我暂时做不到。
您应该添加此方法:
public static void main(String[] args) { //do whatever }
到你的public班级(你想成为你程序的起点)。
public
注意:请记住,main方法签名中的每一件事都应该与我展示的完全一样,除了参数的名称(args),您可以根据需要更改它。
main