Chapter 18

Creating Loops within Loops

IN THIS CHAPTER

Bullet Analyzing loop strategies

Bullet Diagnosing loop problems

Bullet Creating nested loops

If you’re an editor at Wiley Publishing, 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 these 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 kind of thing ...

Get Beginning Programming with Java For Dummies, 6th 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.