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 Data Structures!
You have completed Java Data Structures!
Preview
All objects we create in Java inherit from a base class named Object. That class provides methods you should know about. Let's explore inheritance and overriding.
Resources
Definitions
- A class that is derived from another class is called a subclass (also a derived, extended, or child class).
- The class from which the subclass is derived is called a superclass (also a base or a parent class).
- Polymorphism - The dictionary definition of polymorphism refers to a principle in biology in which an organism or species can have many different forms or stages. This principle can also be applied to object-oriented programming and languages like the Java language. Subclasses of a class can define their own unique behaviors and yet share some of the same functionality of the parent class.
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
representation, we first need to discuss
an object-oriented principle
0:00
that we haven't touched on.
0:04
And that concept is known as inheritance.
0:05
Now the main idea is
pretty straightforward.
0:08
Any class may define
that it is a subclass,
0:11
also known as a child
class, of another class.
0:14
Now the class that the child class
is inherited from
0:18
is called the superclass,
or the parent class.
0:20
By doing this, the child class inherits
0:24
the public fields
and methods from its parent's class.
0:26
We'll explore inheritance
in more detail here shortly.
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