This week's book giveaway is in the JavaScript forum. We're giving away four copies of Getting MEAN with Mongo, Express, Angular, and Node and have Simon Holmes on-line! See this thread for details.

Initially when I=0 and j=0 if(j==i) break; is executed and so control breaks out of the inner loop. In the next iteration of the outter loop, we have i=1 and j=0, this time the first if will not get exeuted and control proceeds to execute the System.out.println()

Output at this point is Element[1, 0]: 2

And the value of sum is 2, which is less than 10, so second if is not executed

Now moving to next iteration of outter loop i=2 and j=0, this time also the first if will not get exeuted and control proceeds to execute the System.out.println()

Output at this point is Element[2, 0]: 9

Now sum is 9+2 =11 greater than 10, so the second if gets executed and comes out of the scope defined by the label outer:

Hope this helps :-)

Only those who will risk going too far can possibly find out how far one can go !!!