Hi,
Could someone give an explanation(walkthrough) of what is going on here. I'm not quite sure how to follow it.
________________________________________________________________
What will be output by the following code?
public class MyFor{
public static void main(
String argv[]){
int i;
int j;
outer:
for (i=1;i <3;i++)
inner:
for(j=1; j<3; j++) {
if (j==2)
continue outer;
System.out.println("Value for i=" + i + " Value for j=" +j);
}
}
}
1) Value for i=1 value for j=1
2) Value for i=2 value for j=1
3) Value for i=2 value for j=2
4) Value for i=3 value for j=1
_______________________________________________________________
The answer is 1) and 2) . I compiled and ran it myself and it's true but i'm still not sure what's going on.
Thanks Very Much,
Tom