Methods Flashcards

1
Q

What does the static keyword do?

A

It allows a method to be called on its own, not as a part of an object.

Makes it standalone.

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

What does the void keyword do?

A

defines a method’s return value as null (doesnt have a return value)

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

What is variable scope?

A

A variable scope is the portion of the program code that that variable is

visible within.

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

What do you have to do to make a method accept arguments?

A

Define it’s parameters.

In the parens next to the method signature, you declare the parameter type and name.

static void Subtract(double first, double second)

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

What is a method parameter?

A

A parameter is a special variable that you declare at the start of a method. It is one of multiple arguments that you are allowing callers to pass through the method.

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