我是 Java 的新手,并试图让东西在我的电脑上运行。
一个简单的“hello world 程序”调用方法失败
class helloworld
{
public static void main(String[] param)
{
helloWorld();
System.exit(0);
}
public static void helloWorld();
{
System.out.println("hello world");
}
}
我收到以下错误:
.\helloworld.java:11: error: missing method body, or declare abstract
public static void helloworld();
^
最佳答案
去掉这一行末尾的分号:public static void helloWorld();
关于java - 缺少方法体,或在 Java 中声明抽象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13866953/