Chapter 4 Book Quiz Flashcards

1
Q

This type of method does not return a value.

A

void

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

This appears at the beginning of a method definition.

A

header

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

The body of a method is enclosed in .

A

curly braces { }

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

A method header can contain .

A

method modifiers
the method return type
the method name
a list of parameter declarations

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

A value that is passed into a method when it is called is known as
a(n)

A

argument

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

A variable that receives a value that is passed into a method is
known as a(n)

A

parameter

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

This javadoc tag is used to document a parameter variable.

A

@param

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

This javadoc tag is used to document a method’s return value

A

@return

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

This statement causes a method to end and sends a value back to
the statement that called the method

A

Return

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

TRUE OR FALSE: You terminate a method header with a
semicolon.

A

False

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

TRUE OR FALSE: When passing an argument to a method, Java
will automatically perform a widening conversion (convert the
argument to a higher-ranking data type), if necessary

A

True

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

TRUE OR FALSE: When passing an argument to a method, Java
will automatically perform a narrowing conversion (convert the
argument to a lower-ranking data type), if necessary.

A

False

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

TRUE OR FALSE: A parameter variable’s scope is the entire
program that contains the method in which the parameter is
declared.

A

False

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

TRUE OR FALSE: When code in a method changes the value of a
parameter, it also changes the value of the argument that was
passed into the parameter

A

False

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

TRUE OR FALSE: When an object, such as a String , is passed
as an argument, it is actually a reference to the object that is
passed

A

True

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

TRUE OR FALSE: The contents of a String object cannot be
changed

A

True

17
Q

TRUE OR FALSE: When passing multiple arguments to a
method, the order in which the arguments are passed is not
important

A

False

18
Q

TRUE OR FALSE: No two methods in the same program can
have a local variable with the same name.

A

True

19
Q

TRUE OR FALSE: It is possible for one method to access a local
variable that is declared in another method

A

False

20
Q

TRUE OR FALSE: You must have a return statement in a
value-returning method

A

True