Jump Statements

In Java, jump statements transfer the control of the program from one position to another conditionally or unconditionally. Java has three jump statements: break, continue and return. The break statement skips rest of the loop and jumps over to the statement following the loop. The break statement can only be used within the body of while, do, for, or switch statement. The break statement has two separate and distinct uses that is Exiting a loop and Exiting a switch statement. The switch statement lets the programmer choose the several blocks of the code to be executed. The break statement when used in a switch takes the control outside the switch. The continue statement is used to move control to the start of the next repetition. The return statement returns the value to the calling code. The body of the method terminates as the return statement is encountered.

To Access the full content, Please Purchase