Chapter 6 Flashcards

1
Q

A method is invoked with a(n) ______.

A

method call

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

A variable known only within the method in which it’s declared is called a(n) _______.

A

local variable

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

The ______ statement in a called method can be used to pass the value of an expression back to the calling method.

A

return

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

The keyword _____ indicates that a method does not return a value.

A

void

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

Data can be added or removed only from the ______ or a stack.

A

top

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

The three ways to return control from a called method to a caller are ______, _______, _______.

A

return; or return expression; or encountering the closing right brace of a method

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

Stacks are known as _______ data structures; the last item pushed (inserted) onto the stack is the first item popped (removed) from the stack.

A

last-in, first-out (LIFO)

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

An object of class ______ produces truly random numbers.

A

Secure-Random

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

The method-call stack contains the memory for local variables on each invocation of a method during a program’s execution. This data, stored as a portion of the method-call stack, is known as the _____ or ______ or the method call.

A

stack frame, activation record

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

If there are more method calls that can be stored on the method-call stack, an error known as a(n) _____ occurs.

A

stack overflow

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

The _____ of a declaration is the portion of a program that can refer to the entity in the declaration by name.

A

scope

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

It’s possible to have several methods with the same name, each operating on different types or numbers of arguments. This feature is called method _____.

A

overloading

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