错误无法解析为变量

时间:2014-04-20 11:36:06

标签: java java.util.scanner

错误:

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的初学者

0 个答案:

没有答案