Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
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.