Chapter 14

Creating Loops within Loops

In This Chapter

arrow Analyzing loop strategies

arrow Diagnosing loop problems

arrow 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 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? ...

Get Beginning Programming with Java® For Dummies®, 3rd 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.