Using Labeled break to Exit Multiple Loops in Java
This article explains how Java's break and continue statements work, demonstrates why a simple break cannot exit nested loops, and shows how to use labeled break (and similarly labeled continue) to terminate all loops at once with clear code examples.