I have tried many times but cant overcome it....
Any help would be appreciated...
for (Type type : types) {
for (Type t : types2) {
if (some condition) {
// Do something and break...
break; // Breaks out of the inner loop
}
}
}
Now I want to break out of two loops at the same time, is it possible?
It is possible by using break Statement with labeled for loop.
then the output will be: