Introduction to Java Programming and Data Structures - Chapter 3 Selections

0.0(0)
studied byStudied by 0 people
0.0(0)
linked notesView linked note
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/18

flashcard set

Earn XP

Description and Tags

Flashcards covering boolean types, comparison and logical operators, if statements (one-way, two-way, multiple alternative), switch statements, conditional operators, and operator precedence/associativity in Java programming.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

19 Terms

1
New cards

boolean Type

A data type in Java that represents a logical value, either true or false, often as the result of a comparison.

2
New cards

Comparison Operators (Relational Operators)

Java operators used to compare two values, such as < (less than),

3
New cards

One-Way if Statement

A control structure in Java that executes a block of statements only if a specified boolean-expression evaluates to true.

4
New cards

Two-Way if Statement (if-else)

A control structure in Java that executes one block of statements if a boolean-expression is true, and a different block if it is false.

5
New cards

Multiple Alternative if Statements

A series of if-else if-else constructs used to evaluate multiple conditions sequentially, where only the statements associated with the first true condition are executed.

6
New cards

Logic Error

An error in programming that causes a program to produce incorrect results, often difficult to find because it does not stop compilation or execution, such as adding a semicolon after an if clause.

7
New cards

Logical Operators

Operators in Java used to combine or modify boolean expressions, including ! (not), && (and), || (or), and ^ (exclusive or).

8
New cards

Logical Negation (!)

A logical operator that reverses the boolean value of an expression, turning true into false and false into true.

9
New cards

Logical Conjunction (&& - AND)

A logical operator that evaluates to true only if both of the boolean expressions it connects are true; otherwise, it is false (short-circuit AND).

10
New cards

Logical Disjunction (|| - OR)

A logical operator that evaluates to true if at least one of the boolean expressions it connects is true; it is false only if both are false (short-circuit OR).

11
New cards

Logical Exclusion (^ - Exclusive OR)

A logical operator that evaluates to true if exactly one of the boolean expressions it connects is true, but not both; otherwise, it is false.

12
New cards

switch Statement

A control structure in Java that allows a program to execute different blocks of code based on the value of a single switch-expression.

13
New cards

switch-expression

The expression within a switch statement that must yield a value of char, byte, short, or int type, determining which case block to execute.

14
New cards

case (in switch statement)

A label within a switch statement that specifies a constant value; if the switch-expression matches this value, the associated statements are executed.

15
New cards

break (in switch statement)

A keyword used at the end of a case block in a switch statement to terminate the execution of the switch statement and prevent fall-through to subsequent cases.

16
New cards

default (in switch statement)

An optional case in a switch statement that specifies actions to be performed if the switch-expression does not match any of the other specified case values.

17
New cards

Conditional Operator (Ternary Operator)

An operator in the form (boolean-expression) ? expression1 : expression2, which evaluates to expression1 if the boolean-expression is true, and expression2 if it is false.

18
New cards

Operator Precedence

A rule that determines the order in which operators in a Java expression are evaluated, such as multiplication before addition or parentheses first.

19
New cards

Operator Associativity

A rule that determines the order of evaluation for operators with the same precedence; most binary operators are left-associative, while assignment operators are right-associative.