英文:
can not find symbol method printIn (string) location: variable out of type PrintStream -java compile error
问题
class Example {
public static void main(String args[]) {
System.out.printIn("This is a simple Java program.");
}
}
我尝试通过命令提示符编译代码。错误信息如下:
Example.java:3: error: cannot find symbol
System.out.printIn("This is a simple Java program.");
^
symbol: method printIn(String)
location: variable out of type PrintStream
1 error
我是Java的初学者。请帮我理解这个错误。
英文:
class Example {
public static void main(String args[]) {
System.out.printIn("This is a simple Java program.") ;
}
}
I tried to compile the code through Command prompt. The error message is as follows:
Example.java:3: error: cannot find symbol
System.out.printIn("This is a simple Java program.") ;
^
symbol: method printIn(String)
location: variable out of type PrintStream
1 error
I am a very beginner in java. Please help to understand the error.
答案1
得分: 5
你写成了printIn
而不是println
。你使用了大写的i
而不是l
(小写的L)。因此编译器找不到这个方法,因此会出现cannot find symbol
错误。
println
中的ln
代表line(行)。
英文:
You have written printIn
rather than println
. You have an uppercase i
not a l
(L). Thus the compiler cannot find the method, thus the error cannot find symbol
occurs.
The ln
in println
is for line.
答案2
得分: 1
class Example {
public static void main(String args[]) {
System.out.println("这是一个简单的Java程序。");
}
}
你使用了错误的方法名printIn
,应该使用println
。
英文:
class Example {
public static void main(String args[]) {
System.out.println("This is a simple Java program.");
}
}
You had the wrong method name printIn
instead of println
.
答案3
得分: 0
这是 System.out.println 你的不正确的句子,因此会引发错误。
英文:
that is System.out.println yours not correct sentence so that its raised error
专注分享java语言的经验与见解,让所有开发者获益!
评论