我今天刚开始一个新的java项目,我遇到了println的问题。这是我的主要方法:
public static void main(String[] args) {
String stringNumGuards = JOptionPane.showInputDialog("How any guards do you have?");
int numGuards = Integer.parseInt(stringNumGuards);
Controller headGuard = new Controller();
System.out.println("You have ", numGuards, " guards");
} //main
javac 输出
Controller.java:10: cannot find symbol
symbol : method println(java.lang.String,int,java.lang.String)
location: class java.io.PrintStream
System.out.println("You have ", numGuards, " guards");
我做错了什么?我以前从未遇到过 println 的问题。