define inheritance with an example
Answers
Answered by
1
Explanation:
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. With inheritance, we can reuse the fields and methods of the existing class. Hence, inheritance facilitates Reusability and is an important concept of OOPs.
Answered by
3
Inheritance is the mechanism of basing an object or class upon another object or class , retaining similar implementation. Also defined as deriving new classes from existing ones such as super class or base class and then forming them into a hierarchy of classes.
_________________________
Similar questions
Hindi,
5 months ago
Math,
5 months ago
English,
5 months ago
Social Sciences,
10 months ago
Social Sciences,
1 year ago