public class BreakingLoop { public static void main(String[] args) { int count = 0; loop_one: for (int k=5;k < 100;k++) { for (int j=3; j < 100; j++) { if (j % 2 == 0) { break; } if (k == 67) { break loop_one; } count ++; } } System.out.println(count); } }
i was searching some mild exercises on the net and i saw this one.. and one part intrigues me.
what is that? the only thing i can notice and i dont know if my assumption is right..is, does it refer to the loops? and how come?loop_one:
when i removed it.. my IDE gave me an error -undefined Label
can anyone kindly give me some explanation about that.. i never encountered such one before
thanks