Saturday, 23 June 2018

How to terminate in multiple loop in Java?

Does the keyword 'break' only jump out of one layer of loop? In this piece of code, there are 3 layers loops, which I want to jump out completely. Is there an easy to do that?



while(){

while(){

for(){
if(a==b){
// I want to jump out of the outer while() loop.
}

}
}
}
// and the logic continues from this line.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...