O'Reilly logo

Java All-in-One For Dummies, 5th Edition by Doug Lowe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4

Making Choices

IN THIS CHAPTER

check Boring into Boolean expressions for fun and profit

check Focusing on your basic, run-of-the-mill if statement

check Looking at else clauses and else-if statements

check Understanding nested if statements

check Considering logical operators

check Looking at the weird ?: operator

check Knowing the proper way to do string comparisons

So far in this book, all the programs have run straight through from start to finish without making any decisions along the way. In this chapter, you discover two Java statements that let you create some variety in your programs. The if statement lets you execute a statement or a block of statements only if some conditional test turns out to be true. And the switch statement lets you execute one of several blocks of statements depending on the value of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required