1/24
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Algorithm
A step-by-step process for solving a problem.
Selection
Control-flow that chooses between paths based on a condition; in Java commonly done with if, if-else, else-if chains, and nested ifs.
Repetition
Control-flow that repeats actions multiple times; in Java implemented with loops such as while, for, and enhanced for.
Boolean expression
An expression that evaluates to a boolean value: true or false; used as conditions in if statements and loops.
If statement
A selection structure that runs a statement/block only when its boolean condition is true; otherwise the body is skipped.
If-else statement
A two-way selection structure where exactly one of two blocks executes: the if block if the condition is true, otherwise the else block.
Else-if chain
A multi-way selection structure where conditions are checked top-to-bottom and only the first true branch executes; the rest are skipped.
Nested if
An if statement placed inside another if statement to represent decisions that depend on earlier decisions.
Block
A group of statements enclosed in braces { } that is treated as a single unit (e.g., for an if body).
Dangling else
The rule that an else pairs with the closest previous unmatched if; indentation doesn’t affect this—braces do.
Boolean literal
A Java literal value of true or false.
Boolean variable
A variable of type boolean that stores true/false (e.g., boolean isFinished = false;).
Relational operator
An operator that compares two values and produces a boolean result (e.g.,
Equality operators (== and !=)
Operators that test whether two values are equal (==) or not equal (!=); for primitives they compare values, for objects == compares references.
Assignment vs. comparison
In Java, = assigns a value to a variable, while == compares two values for equality inside conditions.
String content comparison (.equals)
The method used to compare String contents (characters); preferred over ==, which typically compares object references.
Logical operators (&&, ||, !)
Operators that combine or modify boolean expressions: AND (&&), OR (||), and NOT (!).
Operator precedence (Boolean context)
Evaluation order for common operators: parentheses, !, relational (<
Short-circuit evaluation
With && and ||, Java may skip evaluating the right-hand side: A&&B skips B if A is false; A||B skips B if A is true.
Guard condition
A safe check placed before a risky expression (often using short-circuiting) to prevent errors like division by zero or calling a method on null.
Range check
A compound condition that tests whether a value is between bounds, often using && (e.g., x >= 0 && x <= 10).
NullPointerException
A runtime error that can occur if you call a method/access members on a null reference; often prevented with a null guard (name != null && …).
ArithmeticException (division by zero)
A runtime error that can occur when dividing by zero; often prevented with a guard like (denominator != 0 && …).
De Morgan’s Laws
Equivalences for negating compound conditions: !(A&&B) ↔ (!A||!B) and !(A||B) ↔ (!A&& !B).
Equivalent Boolean expressions
Two boolean expressions that produce the same true/false result for all possible inputs (same logical rule, different form).