Inheritance in Java
In this lesson, you'll learn about an important concept of Object Oriented programming known as Inheritance.
What is inheritance? #
Inheritance
provides a way to create a new class from an existing class. The new class is a specialized version of the existing class such that it inherits elements of the existing class.
Terminology #
- Superclass(Parent Class): This class allows the re-use of its members in another class.
- Derived Class(Child Class or Subclass): This class is the one that inherits from the superclass.
Hence, we can see that classes can be built by using previously created classes!
Notation #
Let’s take a look at the notation necessary for the creation of subclasses. This is done by using the keyword extends
.
Get hands-on with 1400+ tech skills courses.