I\'ve got a nested loop construct like this:
for (Type type : types) {
for (Type t : types2) {
if (some condition) {
// Do somethin
Even creating a flag for the outer loop and checking that after each execution of the inner loop can be the answer.
Like this:
for (Type type : types) {
boolean flag=false;
for (Type t : types2) {
if (some condition) {
// Do something and break...
flag=true;
break; // Breaks out of the inner loop
}
}
if(flag)
break;
}