hi everybody, i am very confusing about this for loops. please tell me the output of this.if possibel please exaplian about what is continue outer, break,continue. thanks. outer: for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { if (i == j) { continue outer; } System.out.println("i = " + i + " j = " + j); } }
Aru
Ranch Hand
Joined: Jul 20, 2000
Posts: 112
posted
0
Hi Teja,
Lemme try to explain this... outer: for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { if (i == j) { continue outer; } System.out.println("i = " + i + " j = " + j); } } In this code, When the compiler encounters "continue outer" for the first time, would be when 1= 0 & j = 0. Then instead of continuing the the second loop the control jumps to the first loop to continue processing ... & so on Thx Aruna
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.