[Personal use] JAVA review (beginner to loop 0-156 episodes): break, while, for, continue, return

Overview

1.break
2.while
3.for
4.continue
5.return

1. break

1.Function

Break out of the current loop.
Insert image description here

2. The use of break in multiple loops: used with labels

Insert image description here

Two, while

Insert image description here

3. for

1.for( ; ; )、for( ; i<10 ; )

Insert image description here

4. continue

1.Function

Used to end this cycle and start the next cycle

2.continue In a multi-level nested loop, like break, you need to use labels to specify which level to jump out of.Insert image description here

5. return

1.Function

Return is used in methods to indicate jumping out of the method. If used in the main function, it means exiting the program.
Insert image description here

Guess you like

Origin blog.csdn.net/qq_43768851/article/details/132227931