CHAPTER 16 — More about Counting Loops

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to home page   hear noise   go to next page

revised: 10/03/98, 08/05/99, 01/20/00, 01/14/06, 12/14/08

CHAPTER 16 — More about Counting Loops

This chapter gives you more practice with counting loops. There are other types of loops, but counting loops are by far the most common and well worth further study.

Chapter Topics:

  • Counting upward by two's
  • The while condition as a gatekeeper
  • Iteration
  • Decrementing the loop control variable
  • Infinite loops
  • Basing a value on the loop control variable

QUESTION 1:

(Review) What three parts of a loop must be coordinated for it to work properly?