Computer Science, asked by kumarujjwal4127, 10 months ago

define inheritance with an example

Answers

Answered by Royalstar785
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 Anonymous
3

 {\huge {\underline{\mathbb {ANSWER}}}}

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