PrepGo

AP Computer Science A Flashcards: Boolean Expressions

Written by AP Content Team, Verified for 2026 AP Exams, Last updated: May 2026

Review key ideas with interactive flashcards. This set includes 10 cards to help you master important concepts.

What relationship does the `>` operator determine between two numeric values?
The `>` operator determines if the numeric value on the left is strictly greater than the numeric value on the right.
Card 1 of 10

All Flashcards (10)

What relationship does the `>` operator determine between two numeric values?
The `>` operator determines if the numeric value on the left is strictly greater than the numeric value on the right.
Given two distinct object references, `obj1` and `obj2`, what is the result of `obj1 != obj2`?
The result is `true` because the `!=` operator compares the object references for reference types, and they are not the same.
If `int a = 5;` and `int b = 5;`, what is the result of `a == b`?
The result is `true` because for primitive types, the `==` operator compares the actual values, which are both 5.
What is the function of the `==` and `!=` operators?
The `==` and `!=` operators are used to determine if two values are the same or not the same, respectively.
What is the result of the Boolean expression `15 <= 10`?
The result is `false`, because 15 is not less than or equal to 10.
What are relational operators?
Relational operators are used in Boolean expressions to compare values and determine the relationship between them, such as whether they are the same or if one is greater than another.
What is a Boolean expression?
A Boolean expression is a piece of code that uses relational operators to compare values and evaluates to a result of either true or false.
Which relational operators are specifically used for comparing numeric values?
Numeric values can be compared using the relational operators <, >, <=, and >= to determine their relationship.
Explain the difference in how `==` compares primitive types versus reference types.
With primitive types, `==` compares the actual values. With reference types, it compares the object references (memory addresses), not the content of the objects.
Determine the result of the expression `(20 > 10) == true`.
The result is `true`. The inner expression `20 > 10` evaluates to `true`, and comparing `true == true` also results in `true`.