I have the following program structure:
outerLoop:
for (i =0; i<x; i++) {
if(check condition) {
a = /* do something to calculate a */
goto jump;
} else {
//do something else
}
}
jump:
if (check condition) {
//do something
goto outerLoop;
}
So like seen above, I want to transfer the control from the if
part of for
loop to the if
condition seen outside the loop. And I want to again jump to the for
loop from the if
statement. How do I do that? Is there a goto
statement in Java?