Jump Statements

Jump statements unconditionally transfer program control within a function. Java has three Jump statements: break, continue and return. Jump statement skips rest of the loops and jumps over to the statement following the loop. Break statement in Java programming is used to jump out of the loop control statements. Breaking a loop instructs the program to immediately quit the current iteration and go to the first statement following the loop. The continue statement is used to move control to the start of the next repetition. Continue statement enables a program to skip over a part of the code and causes the next iteration of the loop. The return statement returns the value to the calling code. The continue statement is used when we want to skip the rest of the statements in the body of the loop and continue with the next iteration of the loop.

Java provides a mechanism to label a block of statements. A label is any valid Java variable name. The return statement in a loop instructs the program to immediately quit the current method and return to the calling method.

To Access the full content, Please Purchase