问答详情
源自:6-1 什么是数组

scores cannot be resolved to a variable

Exception in thread "main" java.lang.Error: Unresolved compilation problem: scores cannot be resolved to a variable 怎么回事

public class HelloWorld {

public static void main(String[] args) {

int[] socres= {58,56,945,35,16};

System.out.println("bla"+scores[1]);

}

}


提问者:慕丝4579565 2017-08-23 16:28

个回答

  • 一个小乖乖
    2017-08-23 16:55:32
    已采纳

    代码int[] 后面是scores不是socres,你拼错了!

  • qq_缘徊_03225888
    2017-08-23 16:56:19

    亲 单词写错了  System.out.println("bla"+scores[1]);   改成socres  就可以了