SlideShare a Scribd company logo
TOPIC- InheritanceTOPIC- Inheritance
Inheritance process of creating aInheritance process of creating a
new class from an existing class.new class from an existing class.
• The existing class that is beingThe existing class that is being
inherited is called the base classinherited is called the base class
and new class that inherits theand new class that inherits the
functionality is called derivedfunctionality is called derived
class.class.
SINGLE
INHERITANCE :-
• The derived class inherits some or all
of the traits of the base class .A
class can also inherit properties from
more than one class or from more
than one level .A derived class can
only one base case is called singel
inheritance .
Topic  inheritance
MULTI LEVEL
INHERITANCE :-
• In this type of inheritance, there are
number of levels and it is used in
that cases where we want to use all
properties in number of levels
according to the requirement . It is
not unusual that a class is derived
from another derived class .
Topic  inheritance
MULTIPLE
INHERITANCE:-
• A class can inherit the attributes of two
or more classes . This is known as multiple
iheritance . Multiple inheritance allows us
to join the features of a number of exiting
classes as a starting point for defining new
classes . It is like a child inheriting the
physical features of one parent and the
intellectuality of other .
Topic  inheritance
HIERARCHICAL
INHERITANCE :-
• The form in which more then one classes
are derived from single base class is know
as hierarchical inheritance . Hierarchical
inheritance is useful in the cases where
there is some hierarchical content in
program . We can cast a number of
problems into hierarchical manner , and
therefore will use hierarchical inheritance
there .
Topic  inheritance
HYBRID
INHERITANCE :-
• In this type of inheritance , we can
have combination of two or more
types . It is when you want to use two
or more type of inheritance in a
single program . Thus , hybrid
iheritance is that from of
inheritance in which we use two or
more than two types of inheritance .
Topic  inheritance
PUBLIC,PRIVATE AND
PROTECTED INHERITANCE
• Inheritance is a process of creating a new class from
an existing class. When a class is derived from an
existing class, all the members of base class are
automatically inherited in the derived class. However,
it is also possible to restrict access to data members
and member functions of the base class in the
derived class.
• The purpuse of restricting access to member of the
base class is to ensure the integrity of the object by
controlling how other classes and parts of the
program(main()) interact
with it.
• In order to achieve this, the base class
is inherited through public, private and
protected access specifiers.these
specifies control the access of
inherited members of the base class in
the derived class and other parts of the
programmain().
Private:
priv_base;
Protected:
prot_base;
Public:
pub_base;

More Related Content

PPTX
Inheritance
PPTX
OO relationships between classes
PPTX
Inheritance in JAVA PPT
PPTX
Lec 1.6 Object Oriented Programming
PPT
Inheritance in java
PPTX
Lec 1.7 Object Oriented Programming
PPTX
Class properties
PDF
Inheritance In Java
Inheritance
OO relationships between classes
Inheritance in JAVA PPT
Lec 1.6 Object Oriented Programming
Inheritance in java
Lec 1.7 Object Oriented Programming
Class properties
Inheritance In Java

What's hot (19)

PPTX
Polymorphism
PPTX
Packages
PPTX
Lec 1.9 oop
PPT
Java inheritance
PDF
Inheritance
PPTX
Lec 1.10 Object Oriented Programming
PPT
Packages in java
PPT
Inheritance and Polymorphism
PPTX
Inheritance
PDF
Swift classes
PPTX
Inheritance ppt
PPTX
PPTX
Introduction to Object-Oriented Concepts and Java
PPTX
Object oriented programming 3 object oriented concepts
PPTX
Lec 1.8 Object Oriented Programming
PPTX
Class Members Access/Visibility Guide (Checklist)
PPT
Introducing object oriented programming (oop)
PPTX
Inheritance in Java
Polymorphism
Packages
Lec 1.9 oop
Java inheritance
Inheritance
Lec 1.10 Object Oriented Programming
Packages in java
Inheritance and Polymorphism
Inheritance
Swift classes
Inheritance ppt
Introduction to Object-Oriented Concepts and Java
Object oriented programming 3 object oriented concepts
Lec 1.8 Object Oriented Programming
Class Members Access/Visibility Guide (Checklist)
Introducing object oriented programming (oop)
Inheritance in Java
Ad

Viewers also liked (19)

DOC
Esquema bullying
PPT
Cookie Rookie Training 2011
PDF
Courseware microsoft outlook 2010
DOC
Esquema homoparentalidade
PPTX
Rock music
DOC
Esquema educação sexual da pessoa com deficiencia
PDF
Camp Coleman Facilities Tour
PPT
Sesión 1.2. aislamiento - exposiciones ocupacionales
DOC
Diário de leitura a descoberta da sexualidade infantil 08.12.15
PPT
Sesión 1.1. bioseguridad - higiene de manos - uso de epp
PDF
Sound Branding- Out with the old, In with the new, V3
PPTX
New Logo Launch
PPT
Sesión 1.4. manejo de residuos - limpieza hospitalaria
PPT
Sesión 1.3. prevención de iaas
PDF
Exec Summ, Aug 2013
PDF
Docencia Universitaria
PPTX
介紹聯合報educoco社群學習平台(3/7發表會簡報)
PDF
Educoco使用手冊 v.1
PPTX
Presentacion en power point
Esquema bullying
Cookie Rookie Training 2011
Courseware microsoft outlook 2010
Esquema homoparentalidade
Rock music
Esquema educação sexual da pessoa com deficiencia
Camp Coleman Facilities Tour
Sesión 1.2. aislamiento - exposiciones ocupacionales
Diário de leitura a descoberta da sexualidade infantil 08.12.15
Sesión 1.1. bioseguridad - higiene de manos - uso de epp
Sound Branding- Out with the old, In with the new, V3
New Logo Launch
Sesión 1.4. manejo de residuos - limpieza hospitalaria
Sesión 1.3. prevención de iaas
Exec Summ, Aug 2013
Docencia Universitaria
介紹聯合報educoco社群學習平台(3/7發表會簡報)
Educoco使用手冊 v.1
Presentacion en power point
Ad

Similar to Topic inheritance (20)

PPTX
Ayan Das_25300121057.pptx
PPTX
OBJECT ORIENTED PROGRAMMING_Unit2_NOTES.pptx
PPTX
object oriented programming unit two ppt
PPTX
Inheritance
PPTX
Inheritance and Polymorphism
PDF
4th_class.pdf
PPTX
Inheritance in java.pptx_20241025_101324_0000.pptx.pptx
PPTX
full defination of final opp.pptx
PPTX
Java(inheritance)
PPTX
OOPS Characteristics (With Examples in PHP)
PPTX
Bethany CR8( kk need for ten idb seen dhi DC
PPTX
Inheritance in oop
PDF
‏‏‏‏‏‏oop lecture objectives will come.pdf
PPTX
OBJECT ORIENTED PROGRAMMING_Unit2_firsthalf Updated.pptx
PPTX
Multiple inheritance in java3 (1).pptx
PPTX
Inheritance in Java is a mechanism in which one object acquires all the prope...
PPTX
arthimetic operator,classes,objects,instant
PPTX
Java chapter 5
PPTX
Inheritance
Ayan Das_25300121057.pptx
OBJECT ORIENTED PROGRAMMING_Unit2_NOTES.pptx
object oriented programming unit two ppt
Inheritance
Inheritance and Polymorphism
4th_class.pdf
Inheritance in java.pptx_20241025_101324_0000.pptx.pptx
full defination of final opp.pptx
Java(inheritance)
OOPS Characteristics (With Examples in PHP)
Bethany CR8( kk need for ten idb seen dhi DC
Inheritance in oop
‏‏‏‏‏‏oop lecture objectives will come.pdf
OBJECT ORIENTED PROGRAMMING_Unit2_firsthalf Updated.pptx
Multiple inheritance in java3 (1).pptx
Inheritance in Java is a mechanism in which one object acquires all the prope...
arthimetic operator,classes,objects,instant
Java chapter 5
Inheritance

Recently uploaded (20)

PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Complications of Minimal Access Surgery at WLH
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
master seminar digital applications in india
PPTX
Lesson notes of climatology university.
PDF
01-Introduction-to-Information-Management.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Cell Structure & Organelles in detailed.
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Pharma ospi slides which help in ospi learning
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Complications of Minimal Access Surgery at WLH
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025
2.FourierTransform-ShortQuestionswithAnswers.pdf
Computing-Curriculum for Schools in Ghana
TR - Agricultural Crops Production NC III.pdf
Microbial diseases, their pathogenesis and prophylaxis
Insiders guide to clinical Medicine.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Renaissance Architecture: A Journey from Faith to Humanism
master seminar digital applications in india
Lesson notes of climatology university.
01-Introduction-to-Information-Management.pdf

Topic inheritance

  • 1. TOPIC- InheritanceTOPIC- Inheritance Inheritance process of creating aInheritance process of creating a new class from an existing class.new class from an existing class. • The existing class that is beingThe existing class that is being inherited is called the base classinherited is called the base class and new class that inherits theand new class that inherits the functionality is called derivedfunctionality is called derived class.class.
  • 2. SINGLE INHERITANCE :- • The derived class inherits some or all of the traits of the base class .A class can also inherit properties from more than one class or from more than one level .A derived class can only one base case is called singel inheritance .
  • 4. MULTI LEVEL INHERITANCE :- • In this type of inheritance, there are number of levels and it is used in that cases where we want to use all properties in number of levels according to the requirement . It is not unusual that a class is derived from another derived class .
  • 6. MULTIPLE INHERITANCE:- • A class can inherit the attributes of two or more classes . This is known as multiple iheritance . Multiple inheritance allows us to join the features of a number of exiting classes as a starting point for defining new classes . It is like a child inheriting the physical features of one parent and the intellectuality of other .
  • 8. HIERARCHICAL INHERITANCE :- • The form in which more then one classes are derived from single base class is know as hierarchical inheritance . Hierarchical inheritance is useful in the cases where there is some hierarchical content in program . We can cast a number of problems into hierarchical manner , and therefore will use hierarchical inheritance there .
  • 10. HYBRID INHERITANCE :- • In this type of inheritance , we can have combination of two or more types . It is when you want to use two or more type of inheritance in a single program . Thus , hybrid iheritance is that from of inheritance in which we use two or more than two types of inheritance .
  • 12. PUBLIC,PRIVATE AND PROTECTED INHERITANCE • Inheritance is a process of creating a new class from an existing class. When a class is derived from an existing class, all the members of base class are automatically inherited in the derived class. However, it is also possible to restrict access to data members and member functions of the base class in the derived class. • The purpuse of restricting access to member of the base class is to ensure the integrity of the object by controlling how other classes and parts of the program(main()) interact with it.
  • 13. • In order to achieve this, the base class is inherited through public, private and protected access specifiers.these specifies control the access of inherited members of the base class in the derived class and other parts of the programmain().