Home » Java Basics » break/continue statement

break/continue statement

Java Break Statement Example

This is an example of how to use the java break statement. 1. Java Break overview The break statement can be used to terminate a for, while, or do-while loop. Also it is used in switch statement to exit the current case.  2. Break in loop example In the example the break statement is used when checking an array’s elements, as ...

Read More »

Continue Java Statement

1. Continue Java Statement In this example, we shall show you how to use the continue keyword statement in Java. The continue statement skips the current iteration of a for, while, or do-while loop and it continues the current flow of the program. In case of an inner loop, the continue statement continues only the inner loop. In this example, ...

Read More »