Continue Statement in Java
Categories: Java 8(JDK1.8)
Suppose a person wants code to execute for the values as per the code is designed to be executed but forcefully the same user wants to skip out the execution for which code should have been executed as designed above but will not as per the demand of the user. In simpler words, it is a decision-making problem as per the demand of the user.
Continue statement is often used inside in programming languages inside loops control structures. Inside the loop, when a continue statement is encountered the control directly jumps to the beginning of the loop for the next iteration instead of executing the statements of the current iteration. The continue statement is used when we want to skip a particular condition and continue the rest execution. Java continue statement is used for all type of loops but it is generally used in for, while, and do-while loops.
In the case of for loop, the continue keyword force control to jump immediately to the update statement.
Whereas in the case of a while loop or do-while loop, control immediately jumps to the Boolean expression.
Syntax: continue keyword along with a semicolon
continue;