AP® Computer Science A glossary
Boolean expression
Also called: condition
Course: AP® Computer Science A Shows up in: Unit 2: Selection and Iteration
An expression that evaluates to a Boolean value, true or false, such as a comparison with a relational operator or a combination with logical operators.
Appears in the course and exam description (CED): 2.2.A.32.5.A.1
Boolean expressions control if statements and loops. They can be stored in a boolean variable.
int age = 16;
boolean canDrive = age >= 16;
System.out.println(canDrive);
Output:
true Learn it properly, with a checkpoint 2.2 Boolean Expressions