Java's control loop structure is no keyword goto, this practice has its advantages, it improves the readability of program flow control, but there are bad places, it reduces the flexibility of program flow control, so said, "God is fair." So, Java to compensate for this shortcoming, Java provides the tag usage of break and continue. The label in Java is an identifier that follows the ":" character. Unlike other languages, the Java language label must be placed in front of the loop to be useful. Here's a look at some examples:
Break
Execution Result:
From the execution results we see that when J equals 4, "break outer" is executed, which is a break that directly ends the outer corresponding external loop, not the one in which the break is located.
Continue
The results of the implementation are as follows:
From the result we can see that J equals 4 when it is never executed. Because, when J equals 4 o'clock, "continue outer" ends the cycle of the outer loop, goes directly to the next loop, and the inner loop is no longer executed.
Source Address: http://blog.csdn.net/mdx20072419/article/details/41823949
Break,continue in Java about the use of tags (reproduced)