找不到符号方法printIn(string),位置:变量out类型为PrintStream – Java编译错误。

huangapple 未分类评论47阅读模式
英文:

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

huangapple
  • 本文由 发表于 2020年4月7日 16:46:35
  • 转载请务必保留本文链接:https://java.coder-hub.com/61076108.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定