In the following code, does the break statement break out of the if statement only or out of the for loop too?
break
if
for
I need it to b
An unlabelled break only breaks out of the enclosing switch, for, while or do-while construct. It does not take if statements into account.
switch
while
do-while
See http://download.oracle.com/javase/tutorial/java/nutsandbolts/branch.html for more details.