+ 1
What is the difference between break and continue?
3 Respuestas
+ 2
The break keyword is used to breaks(stopping) a loop execution, which may be a for loop, while loop, do while or for each loop. The continue keyword is used to skip the particular recursion only in a loop execution, which may be a for loop, while loop, do while or for each loop.
+ 1
A break will stop iterating through the loop and move on, continue on the other hand is used to move to the next item in the loop.
+ 1
BREAK :-
It is a keyword is used to break a loop execution, which may be any loop (for loop, while loop and do while loop).
CONTINUE :-
It is also a keyword which is used to skip the particular iteration in a loop execution, which may be any loop (for loop, while loop and do while loop).