It’s a kind of relationship between two classes which allows one class to inherit code from the other. It represents “is-a” relationship. For e.g. a car is a vehicle. To implement inheritance, one class must inherit or extend behaviors of another class. When we say extend, we mean that a…