Welcome to the Treehouse Community
Looking to learn something new?
Class questions.. I don't understand Instance Methods and Class Methods
I've done a lot of my coding in Java. With instance methods and class methods, I don't see exactly what the difference is. I'm use to mutator and accessor methods in Java, so looking at these and the way they're explained in the videos are a bit confusing..
I may have to reference my Ruby for Java Developers book for this, but I just wanted to see if anyone could help clarify it to me.
Stone Preston42,016 Points
instance methods are called on an instance of a class whereas class methods are called on the class itself. In other words to use an instance methods you have to create a new object and call it on that whereas you dont have to have an instance of a class to use a class method.