What’s the benefit of using inheritance?
What’s the benefit of using inheritance?
The inheritance is the process allow a class to use properties and methods of another class it have benefit we see in the following way,
1.Maintainability:
Easy to identify the error
2.Reusability:
Facility to use public method of base class without rewriting the same
3.Data hiding:
The base class decided to some data in private so it cannot be altered by derived class
4.Code compatibility:
Avoid of typing code again and again.
Bookmarks