Chapter 14
Creating Loops within Loops
IN THIS CHAPTER
Analyzing loop strategies
Diagnosing loop problems
Creating nested loops
If you’re an editor at John Wiley & Sons, Inc., please don’t read the next few paragraphs. In the next few paragraphs, I give away an important trade secret (something you really don’t want me to do).
I’m about to describe a surefire process for writing a best-selling For Dummies book. Here’s the process:
Write several words to create a sentence. Do this several times to create a paragraph.
Repeat the following to form a paragraph: Repeat the following to form a sentence: Write a word.
Repeat the previous instructions several times to make a section. Make several sections and then make several chapters.
Repeat the following to form a best-selling book in the For Dummies series: Repeat the following to form a chapter: Repeat the following to form a section: Repeat the following to form a paragraph: Repeat the following to form a sentence: Write a word.
This process involves a loop within a loop within a loop within a loop within a loop. It’s like a verbal M.C. Escher print. Is it useful, or is it frivolous?
Well, in the world of computer programming, this ...
Get Beginning Programming with Java For Dummies, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.