7.3_Applying the static Keyword Flashcards

1
Q

What does the static methods/variable means?

A

static methods don’t require an instance of the class. They are shared among all users of the class.

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

Static methods are also known as?

A

Utility or Helper methods

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

What are the two main purposes of static methods?

A
  • > Eliminates the need for the caller to instantiate an object just to call the method.
  • > To share state by all instances of a class
How well did you know this?
1
Not at all
2
3
4
5
Perfectly