System.out.printIn cannot find symbol
本问题已经有最佳答案,请猛点这里访问。
每当我试图在命令提示符中编译这个Java程序时,我就对EDCOX1 0产生了一个错误,即说Javac不能找到符号。system.out.print工作正常,但system.out.printin拒绝合作。我已经发布了下面的程序和编译器消息。谢谢你的帮助。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 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 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | 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 |
打印时使用
Typo:
应该是
使用某种IDE(如Eclipse或NETBeBes)来确保在当前上下文中可以使用MeOS。
这里的问题是复制同一行。尽量避免复制/pase。
它是