Chapter IV with an array of process control

4.4 Control loop structure

4.4.1 Using break the loop ends

break for a complete end loop out of the loop body

Not only can it break statement at the end of the cycle, but also directly to end its outer loop. At this time, a need to keep the label in the back break, this tag is used to identify an outer loop.

Java is a label that is followed by ":" identifier. Other language barrier, Java language labels must be placed in front of the cycle have effect. Here's a look at some examples:

 

 4.4.2 Use this cycle continue to ignore the rest of the statement

continue and break functions somewhat similar, the difference is just continue to ignore this cycle the rest of the sentence, and then the next cycle begins and does not end the cycle; and break the cycle itself is completely terminated.

And break Similarly, after continue can keep up with a label for the label identified skip cycle when the cycles of the rest of the statement, the next cycle begins again.

4.4.3 return method ends



Guess you like

Origin www.cnblogs.com/jingpeng77/p/11689360.html