Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
A logical operator is a symbol or word used to connect two or more conditions in order to create complex Boolean expressions. It determines the relationship between these conditions and yields a true or false result based on their evaluation.
Related terms
Negation Operator: The negation operator, represented by the exclamation mark (!), reverses the truth value of a condition. For example, if x is true, then !x will be false.
The AND operator, represented by &&, returns true only if all the conditions connected by it are true. For example, if both x and y are true, then x && y will be true.
The OR operator, represented by ||, returns true if at least one of the conditions connected by it is true. For example, if either x or y (or both) are true, then x || y will be true.