Skip to Main Content
Java For Dummies, 8th Edition
book

Java For Dummies, 8th Edition

by Barry Burd
April 2022
Beginner content levelBeginner
512 pages
11h 32m
English
For Dummies
Content preview from Java For Dummies, 8th Edition

Chapter 6

Controlling Program Flow with Loops

IN THIS CHAPTER

Bullet Using basic looping

Bullet Counting as you loop

Bullet Repeating relentlessly (until the user gives you a clear answer)

In 1966, the company that brings you Head & Shoulders shampoo made history. On the back of the bottle, the directions for using the shampoo read, “LATHER–RINSE–REPEAT.” Never before had a complete set of directions (for doing anything, let alone shampooing your hair) been summarized so succinctly. People in the direction-writing business hailed this as a monumental achievement. Directions like these stood in stark contrast to others of the time. (For instance, the first sentence on a can of bug spray read, “Turn this can so that it points away from your face.” Duh!)

Aside from their brevity, the thing that made the Head & Shoulders directions so cool was that, with three simple words, they managed to capture a notion that’s at the heart of all instruction-giving: the notion of repetition. That last word, REPEAT, took an otherwise bland instructional drone and turned it into a sophisticated recipe for action.

The fundamental idea is that when you’re following directions, you don’t just follow one instruction after ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Programming with Java For Dummies, 6th Edition

Beginning Programming with Java For Dummies, 6th Edition

Barry Burd
Learning Java, 5th Edition

Learning Java, 5th Edition

Marc Loy, Patrick Niemeyer, Daniel Leuck

Publisher Resources

ISBN: 9781119861645Purchase Link