So I'm working on Java Koans and I'm stuck on number 69. Here's the code:
@Koan
public void forLoopContinueLabel() {
int count = 0;
outerLabel:
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 6; j++) {
count++;
if (count > 2) {
continue outerLabel;
}
}
count += 10;
}
// What does continue with a label mean?
// What gets executed? Where does the program flow continue?
assertEquals(count, __);
}
assertEquals
checks if the answer is correct - it sends Koans both arguments and if they match you advance. For example, if one wrote assertEquals(3 + 3, 6)
it would be correct.
The double-underscores mean REPLACE ME
. In the Koans application it says that I need to replace the underscores with 8, but I don't understand exactly how the continue outerLabel
works.
So my question is: Why is count 8?
Thanks in advance. Any help would be appreciated.