错误:的
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
guess cannot be resolved to a variable
at hw2.Demo.getUserGuess(Demo.java:80)
at hw2.Demo.play(Demo.java:23)
at hw2.Demo.main(Demo.java:15)
代码的
private static char[] getUserGuess() {
Scanner input= new Scanner(System.in);
char [] user = new char [ARRAY_SIZE];
for (int i =0; i<ARRAY_SIZE; i++){
System.out.println("plz enter a color guess B G R Y O P");
char c=input.next().charAt(i);
user[i]=c;
//...
我是Java的初学者