Inheritance
-Passing of property(such as member data and member function) from one class to another class is called Inheritance.-The class that gives the properties is called Base class / Super class / Parent class.
-The class that recieves the properties is called Derived class / Sub class / Child class.
Why Inheritance ?
-For code re-usability.-Flexibility to the programmer.
-Extending
-Overriding.
Types of Inheritance :
1. Single Inheritance
2. Multiple Inheritance
3. Multilevel Inheritance
4.Hybrid Inheritance
5. Hierarchical Inheritance
NOTE :
- Java does not support Multiple Inheritance, one child class only have one parent class.
- Java does not support virtual data,virtual methods and virtual classes..
- Java does not support Operation overloading,inline function and templates.
No comments:
Post a Comment