AP® Computer Science A glossary

Equivalent Boolean expressions

Course: AP® Computer Science A Shows up in: Unit 2: Selection and Iteration

Two Boolean expressions that evaluate to the same value in all cases. A truth table can prove they are equivalent.

Appears in the course and exam description (CED): 2.6.A.12.6.A.2

Testing a few values is not a proof: check every combination. De Morgan’s laws are a quick way to rewrite an expression into an equivalent one.

boolean a = true;
boolean b = false;
System.out.println(!(a && b) == (!a || !b));

Output:

true
Learn it properly, with a checkpoint 2.6 Comparing Boolean Expressions

Related terms

Was this page helpful?

No names are ever shown, and every public comment is checked by us first. Please do not include personal details. To get a reply, email [email protected].

↑ Top

Enlarged view of the selected figure