Statements Flashcards

1
Q

Control Flow Statements

A

control the execution of other statements with logic

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

Expression Statements

A

statements built from expressions joined by operators

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

Expressions

A
  • returns a value

- Method invocations and equations using operators are expressions

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

Statements

A
  • Similar to a sentence in natural language
  • Built from one or more expressions
  • Uses of assignment operator, method invocations and the new keyword are all statements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Block

A

a series statements between curly brackets {}

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

Control Flow Statements: Decision

A

use boolean logic to execute one statement instead of another (if the condition has been met or not)

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

Control Flow Statements: Loop

A

repeat a statement so long as boolean expression returns true

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

Switch statements

A

-Evaluates a single expression to take an action based on the value (could have multiple execution paths based on that value)

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

While loop

A
  • runs as long as boolean expression is true

- expression should eventually return false

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

Do-while

A

like a while loop but the statement

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