오늘 새 Java 프로젝트를 시작했고 println에 문제가 있습니다. 여기 내 주요 방법입니다 :기호를 찾을 수 없습니다. 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에 문제가 없었습니다. 이 변수에 문자열을 연결
System.out.println("You have " + numGuards + " guards");
:
쉼표를 + 부호 – andy256