SlideShare a Scribd company logo
1 of 5
INHERITANCEOBJECT ORIENTED PROGRAMMING
INDEX
 Introduction
 Derived class
 visibility modes
 Types of inheritance
 Virtual base class
 Constructors in derived classes
INHERITANCE
 The mechanism of deriving a new class from an old
class is called inheritance.
 The old class is referred as base class and new
one is called as derived class.
 A new class inherits some or all properties from the
base class.
 Inheritance enables reusability.
TYPES OF INHERITANCE
A
B A
B
C
A
B C D
C
A B
SINGLE
INHERITANCE
MULTILEVEL
INHERITANCE
MULTIPLE
INHERITANCE
HIERARCHICAL
INHERITANCE
 Single inheritance: a derived class with only one
base class is called single inheritance.
 Multiple inheritance: a derived class with several
base classes is multiple inheritance.
 Multilevel inheritance: the mechanism of deriving a
class from another derived class is known as
multilevel inheritance.
 Hiererchical inheritance: one class may be inherited
by more than one class is known as hierarchical
inheritance.
TYPES OF INHERITANCE

More Related Content

What's hot

Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4MOHIT TOMAR
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++Paumil Patel
 
Virtual base class
Virtual base classVirtual base class
Virtual base classTech_MX
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++Vineeta Garg
 
Inheritance
InheritanceInheritance
InheritanceTech_MX
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in javaTech_MX
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingAmit Soni (CTFL)
 
Inheritance In C++ (Object Oriented Programming)
Inheritance In C++ (Object Oriented Programming)Inheritance In C++ (Object Oriented Programming)
Inheritance In C++ (Object Oriented Programming)Gajendra Singh Thakur
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPTAjay Chimmani
 
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...Simplilearn
 
Inheritance ppt
Inheritance pptInheritance ppt
Inheritance pptNivegeetha
 
Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Vibhawa Nirmal
 
Abstraction in java
Abstraction in javaAbstraction in java
Abstraction in javasawarkar17
 

What's hot (20)

Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
OOPS Basics With Example
OOPS Basics With ExampleOOPS Basics With Example
OOPS Basics With Example
 
Virtual base class
Virtual base classVirtual base class
Virtual base class
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
Inheritance and polymorphism
Inheritance and polymorphism   Inheritance and polymorphism
Inheritance and polymorphism
 
Inheritance
InheritanceInheritance
Inheritance
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Polymorphism in java
Polymorphism in javaPolymorphism in java
Polymorphism in java
 
Inheritance in Java
Inheritance in JavaInheritance in Java
Inheritance in Java
 
Inheritance In C++ (Object Oriented Programming)
Inheritance In C++ (Object Oriented Programming)Inheritance In C++ (Object Oriented Programming)
Inheritance In C++ (Object Oriented Programming)
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
 
OOP C++
OOP C++OOP C++
OOP C++
 
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
C++ Inheritance Tutorial | Introduction To Inheritance In C++ Programming Wit...
 
Inheritance ppt
Inheritance pptInheritance ppt
Inheritance ppt
 
Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners Object Oriented Programming Concepts for beginners
Object Oriented Programming Concepts for beginners
 
polymorphism
polymorphism polymorphism
polymorphism
 
Abstraction in java
Abstraction in javaAbstraction in java
Abstraction in java
 
07. Virtual Functions
07. Virtual Functions07. Virtual Functions
07. Virtual Functions
 

Similar to Inheritance in Object Oriented Programming

Similar to Inheritance in Object Oriented Programming (20)

Inheritance
InheritanceInheritance
Inheritance
 
E -COMMERCE.ppt
E -COMMERCE.pptE -COMMERCE.ppt
E -COMMERCE.ppt
 
Inheritance
InheritanceInheritance
Inheritance
 
JAVA
JAVAJAVA
JAVA
 
Inheritance
InheritanceInheritance
Inheritance
 
Programming Lesson by Slidesgo.pptx
Programming Lesson by Slidesgo.pptxProgramming Lesson by Slidesgo.pptx
Programming Lesson by Slidesgo.pptx
 
Bca 2nd sem u-3 inheritance
Bca 2nd sem u-3 inheritanceBca 2nd sem u-3 inheritance
Bca 2nd sem u-3 inheritance
 
Chapter25 inheritance-i
Chapter25 inheritance-iChapter25 inheritance-i
Chapter25 inheritance-i
 
Mca 2nd sem u-3 inheritance
Mca 2nd  sem u-3 inheritanceMca 2nd  sem u-3 inheritance
Mca 2nd sem u-3 inheritance
 
Final presentation programming
Final presentation programmingFinal presentation programming
Final presentation programming
 
Inheritance
InheritanceInheritance
Inheritance
 
Inheritance
InheritanceInheritance
Inheritance
 
Programming presentation
Programming presentationProgramming presentation
Programming presentation
 
Ayan Das_25300121057.pptx
Ayan Das_25300121057.pptxAyan Das_25300121057.pptx
Ayan Das_25300121057.pptx
 
Oop lecture 05
Oop lecture 05Oop lecture 05
Oop lecture 05
 
Inheritance
InheritanceInheritance
Inheritance
 
Java(inheritance)
Java(inheritance)Java(inheritance)
Java(inheritance)
 
Seminar on java
Seminar on javaSeminar on java
Seminar on java
 
Object Oriented Programming - 7.1. Inheritance
Object Oriented Programming - 7.1. InheritanceObject Oriented Programming - 7.1. Inheritance
Object Oriented Programming - 7.1. Inheritance
 
Inheritance
InheritanceInheritance
Inheritance
 

More from Ashita Agrawal

Linux operating system - Overview
Linux operating system - OverviewLinux operating system - Overview
Linux operating system - OverviewAshita Agrawal
 
Introductio to Abstract Window Toolkit (AWT)
Introductio to Abstract Window Toolkit (AWT)Introductio to Abstract Window Toolkit (AWT)
Introductio to Abstract Window Toolkit (AWT)Ashita Agrawal
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSAshita Agrawal
 
Biography of Mahatma Gandhi : 1869-1948
Biography of Mahatma Gandhi : 1869-1948Biography of Mahatma Gandhi : 1869-1948
Biography of Mahatma Gandhi : 1869-1948Ashita Agrawal
 
Cloud computing - new class of network based computing
Cloud computing - new class of network based computingCloud computing - new class of network based computing
Cloud computing - new class of network based computingAshita Agrawal
 
constructor and destructor-object oriented programming
constructor and destructor-object oriented programmingconstructor and destructor-object oriented programming
constructor and destructor-object oriented programmingAshita Agrawal
 
Introduction to computer network
Introduction to computer networkIntroduction to computer network
Introduction to computer networkAshita Agrawal
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorAshita Agrawal
 
Testing Machine- universal tester
Testing Machine- universal testerTesting Machine- universal tester
Testing Machine- universal testerAshita Agrawal
 
Adolf Hitler - German politician(world war I)
Adolf Hitler - German politician(world war I)Adolf Hitler - German politician(world war I)
Adolf Hitler - German politician(world war I)Ashita Agrawal
 
Charles babbage - Father of Computing.
Charles babbage - Father of Computing. Charles babbage - Father of Computing.
Charles babbage - Father of Computing. Ashita Agrawal
 
Ada Lovelace-The First Programmer
Ada Lovelace-The First ProgrammerAda Lovelace-The First Programmer
Ada Lovelace-The First ProgrammerAshita Agrawal
 

More from Ashita Agrawal (17)

Linux operating system - Overview
Linux operating system - OverviewLinux operating system - Overview
Linux operating system - Overview
 
Introductio to Abstract Window Toolkit (AWT)
Introductio to Abstract Window Toolkit (AWT)Introductio to Abstract Window Toolkit (AWT)
Introductio to Abstract Window Toolkit (AWT)
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMS
 
Introduction to Sets
Introduction to SetsIntroduction to Sets
Introduction to Sets
 
Business Overview
Business OverviewBusiness Overview
Business Overview
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Biography of Mahatma Gandhi : 1869-1948
Biography of Mahatma Gandhi : 1869-1948Biography of Mahatma Gandhi : 1869-1948
Biography of Mahatma Gandhi : 1869-1948
 
Cloud computing - new class of network based computing
Cloud computing - new class of network based computingCloud computing - new class of network based computing
Cloud computing - new class of network based computing
 
constructor and destructor-object oriented programming
constructor and destructor-object oriented programmingconstructor and destructor-object oriented programming
constructor and destructor-object oriented programming
 
Introduction to computer network
Introduction to computer networkIntroduction to computer network
Introduction to computer network
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
 
Testing Machine- universal tester
Testing Machine- universal testerTesting Machine- universal tester
Testing Machine- universal tester
 
Adolf Hitler - German politician(world war I)
Adolf Hitler - German politician(world war I)Adolf Hitler - German politician(world war I)
Adolf Hitler - German politician(world war I)
 
Charles babbage - Father of Computing.
Charles babbage - Father of Computing. Charles babbage - Father of Computing.
Charles babbage - Father of Computing.
 
Ada Lovelace-The First Programmer
Ada Lovelace-The First ProgrammerAda Lovelace-The First Programmer
Ada Lovelace-The First Programmer
 
Slums In India
Slums In IndiaSlums In India
Slums In India
 
Augmented Reality
Augmented RealityAugmented Reality
Augmented Reality
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 

Recently uploaded (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

Inheritance in Object Oriented Programming

  • 2. INDEX  Introduction  Derived class  visibility modes  Types of inheritance  Virtual base class  Constructors in derived classes
  • 3. INHERITANCE  The mechanism of deriving a new class from an old class is called inheritance.  The old class is referred as base class and new one is called as derived class.  A new class inherits some or all properties from the base class.  Inheritance enables reusability.
  • 4. TYPES OF INHERITANCE A B A B C A B C D C A B SINGLE INHERITANCE MULTILEVEL INHERITANCE MULTIPLE INHERITANCE HIERARCHICAL INHERITANCE
  • 5.  Single inheritance: a derived class with only one base class is called single inheritance.  Multiple inheritance: a derived class with several base classes is multiple inheritance.  Multilevel inheritance: the mechanism of deriving a class from another derived class is known as multilevel inheritance.  Hiererchical inheritance: one class may be inherited by more than one class is known as hierarchical inheritance. TYPES OF INHERITANCE