'.class' expected Error

I get this error when i compile tht following code

Error:

'.class' expected

int j = 0;

^

not a statement

int j = 0;

^

Code:

public static void main(String[] args) {

int counter = 0;

l1:

for (int i=0; i<10; i++) {

l2:

int j = 0;

while (j++ < 10) {

if (j > i) break l2;

if (j == i) {

counter++;

continue l1;

}

}

}

System.out.println(counter);

}

Any ideas

[525 byte] By [Sheebasja] at [2007-10-2 12:41:25]
# 1

Put {} around the lines that are associated with l2:

You do not need to do this with l1: because the statement following l2: is a 'for'

l2: {

int j = 0;

while (j++ < 10) {

if (j > i) break l2;

if (j == i) {

counter++;

continue l1;

}

}

}

atmguya at 2007-7-13 9:46:31 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...