The break statement is used to terminate the loop immediately. The continue statement is used to skip the current iteration of the loop. break keyword is used to indicate break statements in java programming.
What is break and continue statements in Java?
The break statement is used to terminate the loop immediately. The continue statement is used to skip the current iteration of the loop. break keyword is used to indicate break statements in java programming.
What is difference between break and continue?
Break statement mainly used to terminate the enclosing loop such as while, do-while, for or switch statement wherever break is declared. Continue statement mainly skip the rest of loop wherever continue is declared and execute the next iteration.