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 Statement

In this example we shall show you how to use the continue statement. The continue statement skips the current iteration of a for, while , or do-while loop. In the example the continue statement is used when checking an array’s elements, as described: Create a for statement with an int index from 0 up to an int array length, that ...

Read More »