O'Reilly logo

Special Edition Using Java 2 Standard Edition by Geoff Friesen, Chuck Cavaness, Brian Keeton

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

Boolean Operators

Most control flow expressions in Java direct program execution based on a computed true or false value. For instance, as you'll see later in this chapter, an if (expression) statement causes the next statement to be executed only if expression evaluates to true. You can actually write something like if (true), but this is not very useful in general (except for concepts such as conditional compilation, which you'll learn about later). Instead, control mechanisms such as the if statement are usually driven by a Boolean expression.

Note

The use of the term Boolean in this chapter refers to Boolean logic in general and not the Boolean class found in Java. The expressions used in flow control typically evaluate to the true and

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