Methods Flashcards

1
Q

Method

A

A function or procedure that is associated with a class

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

The keyword used when a method does not return a value

A

void

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

Another word for object

A

Instance

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

What must be done first to use an object method?

A

Create an object of that class first. (ex. Scanner)

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

Static method

A

Class method

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

The syntax for calling a static method

A

ClassName.methodName()

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

The syntax for a method header

A

1) modifier
2) returnValueType
3) methodName
4) parameter list

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

Is the modifier required in a method header?

A

No, it is optional

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

public, private, public, static are all examples of:

A

Method modifiers

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

The keyword used if a method is not void.

A

return

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

Which data types “pass by value”

A

Primitive

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

Pass by Value

A

The arguments passed to the method are COPIES of the original

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

Objects (like String) are passed to a method with:

A

Pass by Reference

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

Method Signature

A

methodName (parameter list)

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

Making multiple methods of the same name, but with differing parameters

A

Method Overloading

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