Intro to Java Applications Flashcards

1
Q

a) A(n) ____ begins the body of every method, and a(n) ___ ends the body of every method.

A

a) left brace ({), right brace (}).

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

b)The ___ statement is used to make decisions.

A

b) if.

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

c) ___ begins an end-of-line comment.

A

c) //.

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

d)The ___ object is known as the standard output object.

A

d) System.out.

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

e) ___ are reserved for use by Java.

A

e) Keywords.

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

f)Java applications begin execution at method ___.

A

f) main.

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

g) The ___ after the identifier main indicate that it’s a program building block called a method.

A

g) parenthesis.

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

a) Comments cause the computer to print the text after the // on the screen when the program executes.

A

a) False. Comments do not cause any action to be performed when the program executes. They’re used to document programs and improve their readability.

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

b) All variables must be given a type when they’re declared.

A

b) True.

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

c) Java considers the variables number and NuMbEr to be identical.

A

c) False. Java is case sensitive, so these variables are distinct.

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

d)The remainder operator (%) can be used only with integer operands.

A

d) False. The remainder operator can also be used with non- integer operands in Java.

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

e) The arithmetic operators *, /, %, + and - all have the same level of precedence.

A

e) False. The operators *, / and % are higher precedence than operators + and -.

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