#2) Multiple Inheritance As shown in the above diagram, class C is a subclass that has class A and class B as its parent. In a real-life scenario, a child inherits from its father and mother . This can be considered as an example of multiple inheritance.
Read moreWhat is inheritance in oops with real time example?
OOP is all about real-world objects and inheritance is a way of representing real-world relationships . Here’s an example – car, bus, bike – all of these come under a broader category called Vehicle. That means they’ve inherited the properties of class vehicles i.e all are used for transportation.
Read moreWhat is inheritance with an example?
What is Inheritance? Inheritance is a mechanism in which one class acquires the property of another class . For example, a child inherits the traits of his/her parents.12 Mar 2022
Read more