Java Conditionals Flashcards

1
Q

used in selecting one of many code blocks to be executed.

A

switch statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

breaks out of the switch
block. This stops the execution of more code, and case testing in the block.

A

break statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

If there is no case match, the codes to be run
are specified in the __. A break is
no longer needed in this statement, because it
is the last statement in the switch block.

A

default block / default keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

To combine multiple conditions depending on
your desired results,

A

Logical operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A unary logical operator and simply negates its value:

A

The NOT (!) Operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A binary logical operator that returns true if at least one of the operands is true, otherwise it will return false.

A

The OR (||) Operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A binary logical operator that returns true if all of the operands is true, otherwise it will return false.

A

The AND (&&) Operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

gives us the character at
index 0, the first character of the word, specifically, the
character we need since the user is expected to enter just a character.

A

charAt(0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly