Java Control Structures, Boolean Logic, and Strings

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/16

flashcard set

Earn XP

Description and Tags

Practice vocabulary flashcards covering Java if-statements, Boolean logic, De Morgan's Laws, String indexing, and object comparison methods.

17 Terms

1
New cards

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.

2
New cards

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.

3
New cards

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.

4
New cards

De Morgan's Laws

Two rules explaining how to rewrite Boolean expressions with NOT (!): Law 1 states that !(A && B)= !A ∣∣ !B!(A \ \&\&\ B) = \ !A \ || \ !B, and Law 2 states that !(A ∣∣ B)= !A && !B!(A \ || \ B) = \ !A \ \&\& \ !B.

5
New cards

Boolean Expression

An expression that evaluates to either true or false.

6
New cards

Logical AND (&&\&\&)

A logical operator where both conditions must be true for the entire expression to evaluate to true.

7
New cards

Logical OR (∣∣||)

A logical operator where at least one condition must be true for the entire expression to evaluate to true.

8
New cards

Logical NOT (!!)

A logical operator that reverses the Boolean value of an expression.

9
New cards

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.

10
New cards

String

A sequence of characters used in Java to store text.

11
New cards

String Concatenation

The operation of joining Strings together using the ++ operator.

12
New cards

.length()

A String method that counts and returns the total number of characters in a String.

13
New cards

String Index

The numerical position of a character within a String, starting at index 00 and ending at length−1\text{length} - 1.

14
New cards

.charAt()

A String method used to retrieve a single character at a specified index.

15
New cards

Immutable

A property of Java Strings meaning that their original contents cannot be changed.

16
New cards

== (Equality Operator)

An operator that checks whether two object references point to the same object, or compares primitive values.

17
New cards

.equals()

A method used to compare the actual character contents or text of two String objects.