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
Learn some math shortcuts that integers provide
Learn more
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
Like I was saying earlier,
if we wanted to go overboard,
0:00
we could actually make
one of these Pez objects.
0:00
Nothing's stopping us, right?
0:03
You could totally imagine it.
0:04
Our new Pez class would define some state,
like flavor.
0:06
Maybe it could even store the time that
it was inserted into the dispenser.
0:09
We could determine if it was stale.
0:13
When we call the dispense
method we're about to write,
0:15
we could actually return
one of these Pez objects.
0:18
Or that's going a little overboard,
let's not do that just yet.
0:21
Now, I was being a little silly there.
0:25
But this is actually a pretty hard thing
that you're going to grapple with.
0:27
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