Pages

Showing posts with label Inheritance. Show all posts
Showing posts with label Inheritance. Show all posts

Thursday, May 7, 2020

Inheritance in Java


In this, we will cover below topics:

1) What is Inheritance
2) How to achieve Inheritance?
3) Types of inheritance
4) Constructor
5) this
6) super


1. What is Inheritance:

1. Inheritance is inheriting features of from parent class to child class is called as Inheritance.
2. In java it can be achieved by using extends keyword.
3.  It is used to achieve Polymorphism.
4. types of inheritance: Simple, Multilevel, Hierarchical, multiple, etc.

Realtime Example:

Let’s CONSIDER below example which will clear the concept of inheritance:
How features transfers using Inheritance