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 Inheritance in Java!
You have completed Inheritance in Java!
Preview
In this video we'll learn what it means to 'override' a method and see how to use the 'super' keyword.
This video doesn't have any notes.
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
we got a little confused when the toString
method said that it should be overwritten.
0:00
In Java an override is when a child
class has a method with the exact same
0:01
signature as one in the parent class,
but with a different implementation.
0:06
It's like saying yes,
I do have this method,
0:11
but I'd like to handle it
differently than my parent does.
0:14
Think about all the things you do
differently than your parents,
0:18
that's overriding.
0:22
Let's get more familiar with overrides
by overriding the toString method in
0:23
our animal class.
0:28
Let's close object.java, and
back in our animal class, let's make a new
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