1/5
APCSA 2.4-2.5 Vocab
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Dangling Else
Sometimes with nested ifs we find a type of else that could belong to either if statement. The else clause will always be a part of the closest unmatched if statement in the same block of code, regardless of indentation.
Nested If Statement
Consists of if, if-else, or if-else-if statements within if, if-else, or if-else-if statements.
AND &&
Join two Boolean expressions and the body of the condition will only be executed only if both are true. Has precedence over OR but doesn't have precedence over NOT
OR | |
Join two Boolean expressions and the body of the condition will be executed if one or both are true.
NOT !
Can be used to negate a boolean value. Has precedence over AND and OR
Short Circuit Evaluation
If the left operand (first expression) is sufficient to determine the result, the right operand (second expressions) is not evaluated. Used by OR and AND