Instance Vs Class Methods Notes Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

what is an instance method?

A

An instance method depends on the attributes or instance variables of an instance.
Class#method_name means method_name is an instance method

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

what is a class method?

A
A class method is a method that is called directly on the class.we define class method by adding [self.] to the front of a method name.
Class::method_name means method_name is a class method
How well did you know this?
1
Not at all
2
3
4
5
Perfectly