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

Java

Confused what an object it. An example would be helpful.

I know it has state and behavious but what really defines an object?

1 Answer

An object is a new version of a class.

For example, if you had a class called 'Dog', you could create a new version of this class using the following code.

Dog dog1 = new Dog();

This is code that will create a new Dog object called dog1. You can then use this object to call methods that are contained within the Dog class file.

I hope this helped you out.

Thanks. That really cleared it up.

Craig Dennis
Craig Dennis
Treehouse Teacher

Sure are a lot of Java dogs these days. ;) Thanks Luke!

It sure does. Even more now that Treehouse has it's own Java courses, keep up the good work Craig!