created 12/12/99; revised 01/22/00

CHAPTER 44 --- The do Statement

Loops are so important, and are so common in programs, that there are several Java language features for implementing them. You have already seen while loops and for loops. This chapter looks at do loops.

Only one looping method is strictly necessary in a programming language; for instance, any program could be written using just the while loop. However, the for loop is often very convenient. The do loop is only occasionally convenient. Of the three looping statements, it is used the least. Some programmers prefer not to use it at all.

Chapter Topics:

  • The do statement.
  • Bottom-driven loops.
  • Dangers of bottom-driven loops.

QUESTION 1:

There are several looping statements in Java, although only one (any one of them) is logically necessary.

Are there also several branching statements in Java?    
Click Here after you have answered the question