COP3252 Chapter 6 Flashcards

1
Q

A well-designed method

A

performs a single, well defined task

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

To declare a method as static, place the keyword static before ________ in the method’s declaration

A

The return type

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

Declaring main as ________ allows the JVM to invoke main without creating an instance of the class

A

static

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

In the statement result = calculateValue(x,y);

what are x and y called?

A

arguments

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

Stacks are which type of data structure

LILO
FILO
FIFO
LIFO

A

LIFO

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

What is an overloaded method?

A

has the same name as another method, but different parameters (by number, types or order of the types)

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

Method 1
void getSum( int a, int b)
Method 2
void getSum( double a, double b)

Does method 2 properly overload method B?

A

Yes

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

How are two methods of the same name distinguished?

A

Both number and types of arguments

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