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!
You have completed Java Objects!
Preview
Objects are created from blueprints, or classes. Let's make one.
Resources
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
Programmers have discovered
that all real-world objects share
0:00
two important characteristics.
0:00
They have state and behavior.
0:02
By creating an object
in code that maintains its own state
0:05
and presents its behavior for usage,
you can hide
0:08
how things are actually working
from your users of your object.
0:11
A great example of this is a radio
that has some state.
0:14
Is it on or is it off?
0:18
And what station is it tuned to?
0:20
And it also has behavior
that it exposes to the user,
0:22
like turning the power on
or changing the station.
0:25
How does it work internally?
0:28
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