CHAPTER 42 — More about the for Statement

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   go to next page

created: 01/03/99; revised: 01/22/00, 07/18/02, 05/25/03, 01/29/06

CHAPTER 42 — More about the for Statement

The for is a useful and frequently used statement. This chapter discusses a few more details you should know to make full use of it.

Chapter Topics:

  • Declaring the loop control variable in the for statement
  • Scope of a loop control variable
  • Floating point increments

QUESTION 1:

(Review:) What is the advantage of a for statement over a while statement?