break and continue
break and continue statement
It is sometimes desirable to skip some statements inside the loop or terminate the loop immediately without checking the test expression. In such cases we can use break statements in Java. Please note that Java does not provide Go To statement like other programming languages e.g. C, C++ (The Java keyword list specifies the goto keyword, but it is marked as "not used").
Break statement
The break statement is used with the conditional switch statement and with the do, for, and while loop statements. When a break statement is encountered inside a loop, the loop is immediately terminated and the program control resumes at the next statement following the loop.
Differentiate between break and continue statements
Differentiate between break and continue statements.
No comments