Break continue return the difference

1. break ends the cycle, out of the loop, the loop will not execute code, performs outer loop.

2.continue t terminate the current cycle, continue to the next cycle, the latter continue statement will not be executed in the current cycle, the next cycle continues, the outside loop will execute

3.return return of function is the end of a method, the method ends execution will return in the loop body, natural circulation is over, no matter how deeply nested return

Guess you like

Origin www.cnblogs.com/buxiugangzi/p/12076180.html