1. Functions of return statements
(1) return exits from the current method, returns to the statement of the method called, and continues execution.
(2) return returns a value to the statement that calls this method. The data type of the returned value must be the same as the type of the returned value in the method declaration. You can use forced type conversion to ensure that the data type is the same.
(3) return when void is used to declare that the return type is null in the method description, this format should be used without returning any value.
2. Roles of the break statement
(1) The break statement can only be used in the loop body and switch statement body.
(2) When the break appears in the switch statement body of the loop body, it only jumps out of the switch statement body.
(3) When the break appears in the loop body but is not in the switch statement body, it jumps out of the loop body at the current layer after the break is executed.
(4) In the loop structure, the break statement is applied to make the process jump out of the cycle body of the Current layer, so as to end the cycle of the current layer in advance.
3. Functions of the continue statement
(1) The general form of the continue statement is contonue;
(2) its function is to end this cycle, that is, to skip the remaining statements in the cycle body that have not been executed, and then judge the conditions of the cycle again.
(3) Note: The execution of the continue statement does not terminate the entire loop. In the while and do-while loops, The continue statement causes the process to jump directly to the test section of the loop control condition, and then determines whether the loop continues.
(4) In a for loop, when a continue is encountered, skip the remainder statement in the loop body and evaluate the value of "expression 3" in the for statement, then perform the conditional test of expression 2, and determine whether to execute the For Loop Based on the value of expression 2. In the loop body, no matter what statement the continue is, it will be executed according to the above function, which is different from break.
From: http://www.cnblogs.com/huangy/archive/2008/12/16/1356105.html