代码要写在方法里,你确定你写的不是中文状态下的“ 把光标停在错误的那一行 按ctrl + 1,会有提示的,简单的错误可以帮你自动纠正的,多去学学eclipse的用法
public class HelloWorld{
public static void main(String[] args){
System.out.println("Hello World!");
}
}
这种执行语句应该放在类里面的方法里面,比如:
public class TestClass {
public void printInto(){
System.out.println("Hello World!");
}
public static void main(String[] args) {
}
}