005 - Expressions, Statements, and Blocks Flashcards

1
Q

expressions are the core components of _________

A

statements

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

statements may be grouped into __________.

A

blocks

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

__________ is a construct made up of variables, operators, and method invocations, which are constructed according to the syntax of the language, that evaluates to __________.

A

An expression

a single value

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

You can specify exactly how an expression will be evaluated using __________

A

balanced parenthesis: ( and )

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

__________ are roughly equivalent to sentences in natural languages. They form a complete unit of execution.

A

Statements

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

statements terminate the expressions with __________. Such statements are called expression statements.

A

a semicolon (;)

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

A __________ declares a variable.

A

declaration statement

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

__________ regulate the order in which statements get executed.

A

control flow statements

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

A __________ is a group of zero or more statements between balanced braces and can be used anywhere a single statement is allowed

A

block

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

Operators may be used in building ___, which compute values.

A

Expressions

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

Expressions are the core components of ___.

A

Statements

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

Statements may be grouped into ___.

A

Blocks

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

The following code snippet is an example of a ___ expression.
1 * 2 * 3

A

Compound

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

Statements are roughly equivalent to sentences in natural languages, but instead of ending with a period, a statement ends with a ___.

A

Semicolon

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

A block is a group of zero or more statements between balanced ___ and can be used anywhere a single statement is allowed.

A

Curly braces

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

Identify the following kinds of expression statements:

aValue = 8933.234;
aValue++;
System.out.println("Hello World!");
Bicycle myBike = new Bicycle();
A
aValue = 8933.234; -> assignment statement  
aValue++; expression; -> increment statement  
System.out.println("Hello World!"); ; -> method invocation statement 
Bicycle myBike = new Bicycle(); declaration ; -> object creation statement
17
Q

Operators may be used in building __________, which compute values.

A

expressions