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
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
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
2,908 Points

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