[英]Unable to use System.out in Java
public class Main{
public static void main(String[] args){
new World();
System.out.println("HelloWorld Java");
}
}
Compiling with javac results in this error: 使用javac进行编译会导致此错误:
C:\Users\Ben\Documents\GitHub\ECS\src\Main.java:5: error: cannot find symbol
System.out.println("HelloWorld Java");
^
symbol: variable out
location: class System
It's the most puzzling error I've ever gotten. 这是我遇到的最令人费解的错误。 Although I suppose it's important to note that this is my first real programming without the use of an IDE.
虽然我认为重要的是要注意这是我第一次没有使用IDE的真正编程。
You have a local class called System. 你有一个名为System的本地类。 Don't use standard JDK names for your own classes.
不要为自己的类使用标准JDK名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.