Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Objects Harnessing the Power of Objects Filling the Dispenser

Can anyone explain to me what is a object and a instance?

What is a object and a instance?

Thank You!

1 Answer

Jennifer Nordell
Jennifer Nordell
Treehouse Teacher

Hi there! Let's say for example that you own a construction business and you have a contract to build forty houses. The object would be the blueprints for the house. The properties would be the dimensions, color, address etc. Each separate house that you build is an instance. They aren't all the same house. Each instance of this house gets its own address, and maybe customer A wants their house white while customer B wants their house brown. So using this blueprint and creating a new instance of the house we can create something that is very similar, but distinct from the one before it.

Hope this helps! :sparkles:

Dinu Comendant
Dinu Comendant
5,859 Points

Thank you! I wish every Treehouse teacher could explain everything in this simple manner.