Advertisements
Advertisements
प्रश्न
Define the following with an example.
Inheritance
व्याख्या
उत्तर
It is an OOP principle according to which one class acquires the features of another class. With the help of inheritance, the components in the Base class can be reused to perform some other task in the Derived class (reusability).
Example: The Car class (subclass) inherits characteristics and methods from the Vehicle class (superclass).
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 1.01: Introduction to Object Oriented Programming Concepts - EXERCISES [पृष्ठ ९]