This course will be retired on July 31, 2026. We recommend "Practice Java Objects - Word Guessing Game" for up-to-date content.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Java Objects (2016)!
You have completed Java Objects (2016)!
Preview
Objects are created from blueprints, or classes. Let's make one.
Learn more
- You might not have seen a PEZ Dispenser before. I hope you can experience it someday if you haven't. It's a lot of fun.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
objects share 2 important characteristics
they have state and behavior.
0:00
By creating an object in code
that maintains its own state and
0:04
presents its behavior for usage.
0:07
It allows you to hide how things
are actually working from
0:09
users of your object.
0:11
A great example of this is a radio
that has some state is it on or
0:13
off what station is it?
0:18
[MUSIC]
And
0:20
it also has some behavior that
it exposes to the use for
0:20
the power on change the station.
0:23
How does it actually work?
0:26
I have no idea.
0:27
Its inner workings are hidden from me but
its behavior is exposed and
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up