System.out.printIn找不到符号

Sno*_*eef 1 java

每当我尝试在命令提示符中编译此Java程序时,我都会收到一条错误消息,System.out.printIn指出javac无法找到符号.System.out.print工作正常,但System.out.printIn拒绝合作.我已经发布了下面的程序和编译器消息.谢谢您的帮助.

    public class BeerSong {
public static void main (String[] args) {
int beerNum = 99;
String word = "bottles";

while (beerNum > 0) {

  if (beerNum == 1) {
    word = "bottle"; //singular, ONE bottle
}

System.out.printIn(beerNum + " " + word + "of beer on the wall");
System.out.printIn(beerNum + " " + word + "of beer.");
System.out.printIn("Take one down.");
System.out.printIn("Pass it around.");
beerNum = beerNum - 1;

if (beerNum > 0) {
    System.out.printIn(beerNum + " " + word + " of beer on the wall");
}   else {
    System.out.printIn("No more bottles of beer on the wall");
} //end else
} //end while loop
} //end main method
} //end class
Run Code Online (Sandbox Code Playgroud)
C:\Users\Jesse\Desktop>javac BeerSong.java
BeerSong.java:12: cannot find symbol
symbol  : method printIn(java.lang.String)
location: class java.io.PrintStream
    System.out.printIn(beerNum + " " + word + "of beer on the wall");
              ^
BeerSong.java:13: cannot find symbol
symbol  : method printIn(java.lang.String)
location: class java.io.PrintStream
    System.out.printIn(beerNum + " " + word + "of beer.");
              ^
BeerSong.java:14: cannot find symbol
symbol  : method printIn(java.lang.String)
location: class java.io.PrintStream
    System.out.printIn("Take one down.");
              ^
BeerSong.java:15: cannot find symbol
symbol  : method printIn(java.lang.String)
location: class java.io.PrintStream
    System.out.printIn("Pass it around.");
              ^
BeerSong.java:19: cannot find symbol
symbol  : method printIn(java.lang.String)
location: class java.io.PrintStream
        System.out.printIn(beerNum + " " + word + " of beer on the wall");
                  ^
BeerSong.java:21: cannot find symbol
symbol  : method printIn(java.lang.String)
location: class java.io.PrintStream
            System.out.printIn("No more bottles of beer on the wall");
                      ^
6 errors
Run Code Online (Sandbox Code Playgroud)

MBy*_*ByD 16

l(小写L)打印,不打印I(大写i).

  • 另外:`ln`代表打印行中的`line`,而不是printIn => print ... input?!;) (3认同)