O'Reilly logo

Oracle Certified Associate, Java SE 7 Programmer Study Guide by Richard M. Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Looping Constructs

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:

  • For statement
  • For-each statement
  • While statement

    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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required