1/16
Practice vocabulary flashcards covering Java if-statements, Boolean logic, De Morgan's Laws, String indexing, and object comparison methods.
If Statement
A conditional structure that checks whether a condition is true; if true, the code inside executes, and if false, the code is skipped.
If/Else Statement
A conditional structure giving the program two choices where the if section executes if the condition is true, the else section executes if false, and only one section runs.
If/Else-If Statement
A conditional structure checked from top to bottom that allows choosing between more than two possibilities; only the first true condition executes while the rest are skipped.
De Morgan's Laws
Two rules explaining how to rewrite Boolean expressions with NOT (!): Law 1 states that !(A && B)= !A ∣∣ !B, and Law 2 states that !(A ∣∣ B)= !A && !B.
Boolean Expression
An expression that evaluates to either true or false.
Logical AND (&&)
A logical operator where both conditions must be true for the entire expression to evaluate to true.
Logical OR (∣∣)
A logical operator where at least one condition must be true for the entire expression to evaluate to true.
Logical NOT (!)
A logical operator that reverses the Boolean value of an expression.
Short-Circuit Evaluation
A process where Java stops checking an expression early: for &&, it stops if the first condition is false; for ∣∣, it stops if the first condition is true.
String
A sequence of characters used in Java to store text.
String Concatenation
The operation of joining Strings together using the + operator.
.length()
A String method that counts and returns the total number of characters in a String.
String Index
The numerical position of a character within a String, starting at index 0 and ending at length−1.
.charAt()
A String method used to retrieve a single character at a specified index.
Immutable
A property of Java Strings meaning that their original contents cannot be changed.
== (Equality Operator)
An operator that checks whether two object references point to the same object, or compares primitive values.
.equals()
A method used to compare the actual character contents or text of two String objects.