It is often desirable to repeat a sequence of actions again and again. For example, we may want to display information about the employees in an organization stored in an array. Each element of the array might hold a reference to a
Employee object. A call to methods of the object would be placed inside a looping construct.
In Java there are four looping constructs available:
d. while statement
In addition, the break and continue statements are used within a loop to control how the loop behaves. The break statement is used to prematurely exit or short circuit the loop and is discussed in the The break statement section. As we observed in the The switch statement section in ...