Let’s first look at the break keyword. The break keyword is mainly used in loop statements or switch statements to jump out of the entire statement block.
It can also jump out of the innermost loop and continue to execute the statements below the loop.
Grammar format
break;
For example:
##(Video tutorial recommendation:java video)
Output result:10 20
continue;
10 20 40 50
The above is the detailed content of What are the functions of break and continue keywords in java. For more information, please follow other related articles on the PHP Chinese website!