Back to Boolean Expressions and if Statements

Lesson PreviewLesson 5 of 8 in this unit

3.5 Compound Boolean Expressions

Part of Boolean Expressions and if Statements in AP® Computer Science A. Read the opening section, then create a free account for the full interactive lesson, practice, and progress tracking.

Before getting into compound boolean expressions, there are two new operators that must be introduced: the AND operator and the OR operator.

  • AND (&&): Returns true only if both operands are true.
  • OR (||): Returns true if at least one operand is true.

You can also have more than one of the following compound logical operators to combine boolean expressions together.

Continue the full lesson in Stellar

Create a free account to unlock the remaining sections, checkpoints, course practice, and progress tracking for AP® Computer Science A.