gauthamkuragayalak
3,397 views
6 slides
Dec 13, 2013
Slide 1 of 6
1
2
3
4
5
6
About This Presentation
No description available for this slideshow.
Size: 49.72 KB
Language: en
Added: Dec 13, 2013
Slides: 6 pages
Slide Content
INHERITANCE
INHERITANCE OOP allows class to create new classes which may have some common feature to the exiting classes this is achieved by inheritance. Inheritance is a process of creating new class from the existing class. The existing classes are called base class or super class and the inherited classes are called derived classes or sub class
Types of inheritance Single inheritance Multiple inheritance multi-level inheritance
Single inheritance In this case there is only 1 base and derived class and inheritance take place between them. For ex:- Class animal { Bones Legs hand } Class vertebrates { Bones Legs }
Multiple inheritance I f the child class interact from more than one parent class the it is called multiple inheritance. Class aquatic animals { Breath in water Gills } Class land animals { Breath in air Lungs } Class amphibian { Breath in water Breath in air Lungs Water }
M ulti-level inheritance W hen a sub class is derived from a class which is derived from some other class then it is called multi –level inheritance. class transport { Fly Sail } Class water transport { Sail No of passenger } Class boats { sail No of passenger }