开发者

Java syntax error on tokens, misplaced constructs - array initialization [closed]

开发者 https://www.devze.com 2023-01-29 19:53 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a small geographic 开发者_如何学编程area, a specific moment in time,or an extraordinarily narrow situation that is not
This question is unlikely to help any future visitors; it is only relevant to a small geographic 开发者_如何学编程area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

I have the following code in Java 5:

for (Object o : theList) {
    for (int k=0; k<theList.size(); k++)
        int[][] m = new int[7][7];
    m = theList.get(k);
    for (int i=0; i<7; i++) {
        for (int j=0; j<7; j++) {
            System.out.println(m[i][j]);
        }
        System.out.println();
    }
    System.out.println();
}
...
}

On the line with

int[][] m = new int[7][7]

it is telling me "Syntax error on token(s), misplaced construct(s)". Any idea what I'm doing wrong? Thanks.

0

精彩评论

暂无评论...
验证码 换一张
取 消