INHERITANCE WHAT IS INHERITANCE INHERITENCE IS ACAPACITY OF

  • Slides: 11
Download presentation
INHERITANCE

INHERITANCE

WHAT IS INHERITANCE ? ■ INHERITENCE IS ACAPACITY OF A ONE CLASSTO INHERIT PROPERTIES

WHAT IS INHERITANCE ? ■ INHERITENCE IS ACAPACITY OF A ONE CLASSTO INHERIT PROPERTIES FROM ANOTHER CLASS

TYPE OF INHERITANCE ■ SINGLE LEVEL INHERITANCE ■ MULTI-LEVEL INHERITANCE ■ MULTIPILE INHERITANCE ■

TYPE OF INHERITANCE ■ SINGLE LEVEL INHERITANCE ■ MULTI-LEVEL INHERITANCE ■ MULTIPILE INHERITANCE ■ HERARCHAL INHERITANCE ■ HYBRID INHERITANCE

SINGLE LEVEL INHERITANCE : Single inheritance is safer than multiple inheritance if it is

SINGLE LEVEL INHERITANCE : Single inheritance is safer than multiple inheritance if it is approached in the right way. It also enables a derived class to call the parent class implementation for a specific method if this method is overridden in the derived class or the parent class constructor.

MULTIPLE INHERITANCE : Multiple inheritance is a feature of some object-oriented computer programming languages

MULTIPLE INHERITANCE : Multiple inheritance is a feature of some object-oriented computer programming languages in which an object or class can inherit characteristics and features from more than one parent object or parent class.

MULTI-LEVEL INHERITANCE Inheritance is the process of inheriting properties of objects of one class

MULTI-LEVEL INHERITANCE Inheritance is the process of inheriting properties of objects of one class by objects of another class. . When a class is derived from a class which is also derived from another class, i. e. a class having more than one parent classes, such inheritance is called Multilevel Inheritance.

HERARCHAL INHERITANCE : When more than one classes are derived from a single base

HERARCHAL INHERITANCE : When more than one classes are derived from a single base class, such inheritance is known as Hierarchical Inheritance , where features that are common in lower level are included in parent class.

HYBRID INHERITANCE : Hybrid inheritance is a combination of multiple inheritance and multilevel inheritance.

HYBRID INHERITANCE : Hybrid inheritance is a combination of multiple inheritance and multilevel inheritance. A class is derived from two classes as in multiple inheritance. However, one of the parent classes is not a base class. It is a derived class.

ADVANTAGE : ■ The most frequent classes , ■ use of inheritance is for

ADVANTAGE : ■ The most frequent classes , ■ use of inheritance is for deriving classes which provides reusability. ■ The existing classes remain unchanged. ■ the development time of software is reduced . using existing

Disadvantage : ■ The inheritance is that the two classes(base class and super class)

Disadvantage : ■ The inheritance is that the two classes(base class and super class) are tightly coupled that is the classes are dependent on each other. . It increases the and efforts take to jump through different levels of the inheritance. time