SlideShare a Scribd company logo
4
Most read
5
Most read
9
Most read
Sharda University
Department Of Computer Science And Engineering
School Of Engineering And Technology
Greater Noida, U. P.
Presented By
Hirra Sultan
CSE-B 2nd year
Roll No. 120101091
Enrollment No. 2012017740
Supervisor: Mr. A. K. Sahoo
prlhirr@gmail.com
Introduction
Background
 The first OOP language designed for the
first personal computer was smalltalk.
 When OOP was integrated into C
language, the resulting language was
called C++ and it became the first object-
oriented language to be widely used
commercially.
 Later java and other OOP languages were
developed.
Concept of Inheritance
 Inheritance is that feature of an OOP language
which allows reusability of code of a class and
is considered corner stone of OOP languages.
 Using inheritance, we can create a general
class that defines traits common to a set of
related items.
 This class may then be inherited by other,
more specific classes, each adding only those
things that are unique to the inheriting class.
 Base class: The class which gets inherited is
called a base class. The code of this class is
passed on to subclasses where it is reused.
 Derived class: A subclass is a derived class
which inherits the base class and uses its
member functions.
 Un-inheritable class: A class may be
declared as un-inheritable by adding certain class
modifiers to the class declaration before the
"class" keyword and the class identifier
declaration. Such sealed classes
restrict reusability.
Definitions
Types of Inheritance
 Single Inheritance: In single
inheritance there is only one super class
and only one sub class.
 Multi-level inheritance: In multi-level
inheritance a derived class is inherited by
another class thus making multiple levels.
 Multiple Inheritance: A class can inherit
the attributes of two or more classes. This
is known as multiple inheritance.
 Hierarchical inheritance: When a base
class is inherited by multiple derived
classes it is called hierarchical inheritance.
 Hybrid inheritance: This is a mixture of
two or more inheritances in a single code.
Inheritance may be derived in three forms
which decides the way inherited data
members can be used.
 Public Inheritance: Public members of
the base class become public members of
the derived class and protected members
of the base class
become protected members of the derived
class.
 Protected Inheritance: When
deriving from a protected base class, public
and protected members of the base class
become protected members of the derived
class.
 Private Inheritance: When deriving
from a private base class, public and
protected members of the base class
become private members of the derived
class.
Inheritance in C++
 In C++ all the five types of inheritances are
applicable.
 Friend functions and constructors can’t be
inherited.
 The general syntax of inheritance is:
class derived-class-name : visibility-mode base-
class-name
{
…// members of derived class
};
Inheritance in Java
 The general syntax of inheritance is:
Class Subclass-name extends superclass-
name
{
//methods and fields
}
 The keyword extends indicates that we are
making a new class that derives from an
existing class.
 Multiple and hybrid inheritance is not
supported. This reduces the program
complexity.
 Constructors are not inherited by a subclass.
Inheritance in Python
 Instances inherit from classes, and classes
inherit from super classes.
 Python supports a limited form of multiple
inheritance.
 The syntax for inheritance in python is:
class DerivedClassname
(BaseClassName):
<statement-1>
.
<statement-N>
Inheritance in ADA
 In Ada 95 terminology, types that can have
parents or children are termed “tagged
types”, and have the keyword “tagged” as
part of their definition.
 If we don't redefine a subprogram for a
given type, the closest ancestor's defined
subprogram will be used.
Advantages
 We save time because much of the code
needed for our class is already written.
 We can extend and revise a parent class
without corrupting the existing parent class
features.
Disadvantages
 Removing or swapping out a superclass
will usually break subclasses.
 It's inflexible.
 Inheritance relationships generally can't
be altered at runtime.
Inheritance in oops

More Related Content

What's hot (20)

PPTX
Inheritance in Object Oriented Programming
Ashita Agrawal
 
PPTX
Inheritance in c++
Vineeta Garg
 
PPTX
Chapter 07 inheritance
Praveen M Jigajinni
 
PPT
Java interfaces
Raja Sekhar
 
PDF
Java threads
Prabhakaran V M
 
PPTX
Inheritance ppt
Nivegeetha
 
PPTX
Classes, objects in JAVA
Abhilash Nair
 
PPT
friend function(c++)
Ritika Sharma
 
PPTX
Inheritance in java
yash jain
 
PPT
Object Oriented Programming Concepts
thinkphp
 
PPT
Class and object in C++
rprajat007
 
PDF
Operator overloading C++
Lahiru Dilshan
 
PPTX
07. Virtual Functions
Haresh Jaiswal
 
PPTX
Abstract class in c++
Sujan Mia
 
PPTX
Java abstract class & abstract methods
Shubham Dwivedi
 
PPTX
Access modifiers in java
Madishetty Prathibha
 
PPSX
Inheritance
Selvin Josy Bai Somu
 
PPTX
Polymorphism in java
Elizabeth alexander
 
PPT
Inheritance in java
Lovely Professional University
 
PPTX
Type casting in java
Farooq Baloch
 
Inheritance in Object Oriented Programming
Ashita Agrawal
 
Inheritance in c++
Vineeta Garg
 
Chapter 07 inheritance
Praveen M Jigajinni
 
Java interfaces
Raja Sekhar
 
Java threads
Prabhakaran V M
 
Inheritance ppt
Nivegeetha
 
Classes, objects in JAVA
Abhilash Nair
 
friend function(c++)
Ritika Sharma
 
Inheritance in java
yash jain
 
Object Oriented Programming Concepts
thinkphp
 
Class and object in C++
rprajat007
 
Operator overloading C++
Lahiru Dilshan
 
07. Virtual Functions
Haresh Jaiswal
 
Abstract class in c++
Sujan Mia
 
Java abstract class & abstract methods
Shubham Dwivedi
 
Access modifiers in java
Madishetty Prathibha
 
Polymorphism in java
Elizabeth alexander
 
Inheritance in java
Lovely Professional University
 
Type casting in java
Farooq Baloch
 

Viewers also liked (20)

PPTX
Inheritance
Sapna Sharma
 
PPT
Inheritance, Object Oriented Programming
Arslan Waseem
 
PPTX
Inheritance in C++
Laxman Puri
 
PPTX
inheritance c++
Muraleedhar Sundararajan
 
PPT
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
cprogrammings
 
PPTX
Inheritance in JAVA PPT
Pooja Jaiswal
 
PPT
Oops ppt
abhayjuneja
 
PPT
C++ Inheritance
Jussi Pohjolainen
 
PPTX
Constructors & destructors
ForwardBlog Enewzletter
 
PPTX
Inheritance
Tech_MX
 
PPTX
Constructor & destructor
Saharsh Anand
 
PPT
Inheritance
poonam.rwalia
 
PPSX
Inheritance
Srinath Dhayalamoorthy
 
PPTX
Types of Inheritance
Kimmer Collison-Ris
 
PDF
Constructors and Destructors
Dr Sukhpal Singh Gill
 
PPT
Constructor & Destructor
KV(AFS) Utarlai, Barmer (Rajasthan)
 
PPTX
Constructor ppt
Vinod Kumar
 
PPT
Inheritance OOP Concept in C++.
MASQ Technologies
 
PPT
Csharp4 inheritance
Abed Bukhari
 
PDF
4GMAT Diagnostic Test Q14 - Problem Solving - Coordinate Geometry
4gmatprep
 
Inheritance
Sapna Sharma
 
Inheritance, Object Oriented Programming
Arslan Waseem
 
Inheritance in C++
Laxman Puri
 
inheritance c++
Muraleedhar Sundararajan
 
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
cprogrammings
 
Inheritance in JAVA PPT
Pooja Jaiswal
 
Oops ppt
abhayjuneja
 
C++ Inheritance
Jussi Pohjolainen
 
Constructors & destructors
ForwardBlog Enewzletter
 
Inheritance
Tech_MX
 
Constructor & destructor
Saharsh Anand
 
Inheritance
poonam.rwalia
 
Types of Inheritance
Kimmer Collison-Ris
 
Constructors and Destructors
Dr Sukhpal Singh Gill
 
Constructor & Destructor
KV(AFS) Utarlai, Barmer (Rajasthan)
 
Constructor ppt
Vinod Kumar
 
Inheritance OOP Concept in C++.
MASQ Technologies
 
Csharp4 inheritance
Abed Bukhari
 
4GMAT Diagnostic Test Q14 - Problem Solving - Coordinate Geometry
4gmatprep
 
Ad

Similar to Inheritance in oops (20)

PPTX
Introduction to Inheritance
Keshav Vaswani
 
PDF
lecture 6.pdf
WaqarRaj1
 
PPTX
Inheritance
prashant prath
 
PDF
Inheritance
Prof. Dr. K. Adisesha
 
PPTX
Lecture 5.mte 407
rumanatasnim415
 
PPTX
Inheritance.pptx
preetirawat242004
 
DOCX
oop database doc for studevsgdy fdsyn hdf
itxminahil29
 
PPSX
Inheritance and Polymorphism in Oops
LalfakawmaKh
 
PPTX
Inheritance
Burhan Ahmed
 
PPTX
Inheritance
Munsif Ullah
 
PPTX
inheriTANCE IN OBJECT ORIENTED PROGRAM.pptx
urvashipundir04
 
PPTX
Inheritance
rajshreemuthiah
 
PPTX
Inheritance
Amit Dixit
 
PPTX
Ritik (inheritance.cpp)
RitikAhlawat1
 
PPTX
Inheritance
SangeethaSasi1
 
PPT
Inheritance in C++
Shweta Shah
 
PPTX
Inheritance
lalithambiga kamaraj
 
PPTX
Object oriented programming new syllabus presentation
iqraamjad1405
 
PPTX
inheritance_OOPC_datastream.ppttttttttttttttx
SanskritiGupta39
 
PPTX
Introduction to inheritance and different types of inheritance
huzaifaakram12
 
Introduction to Inheritance
Keshav Vaswani
 
lecture 6.pdf
WaqarRaj1
 
Inheritance
prashant prath
 
Lecture 5.mte 407
rumanatasnim415
 
Inheritance.pptx
preetirawat242004
 
oop database doc for studevsgdy fdsyn hdf
itxminahil29
 
Inheritance and Polymorphism in Oops
LalfakawmaKh
 
Inheritance
Burhan Ahmed
 
Inheritance
Munsif Ullah
 
inheriTANCE IN OBJECT ORIENTED PROGRAM.pptx
urvashipundir04
 
Inheritance
rajshreemuthiah
 
Inheritance
Amit Dixit
 
Ritik (inheritance.cpp)
RitikAhlawat1
 
Inheritance
SangeethaSasi1
 
Inheritance in C++
Shweta Shah
 
Object oriented programming new syllabus presentation
iqraamjad1405
 
inheritance_OOPC_datastream.ppttttttttttttttx
SanskritiGupta39
 
Introduction to inheritance and different types of inheritance
huzaifaakram12
 
Ad

More from Hirra Sultan (8)

PPTX
Processes
Hirra Sultan
 
DOCX
report
Hirra Sultan
 
PPTX
Presentation
Hirra Sultan
 
PPTX
Superconductors And their Applications
Hirra Sultan
 
PPTX
Attribute oriented analysis
Hirra Sultan
 
PPTX
Control Flow Testing
Hirra Sultan
 
PPT
Monopolistic Competition
Hirra Sultan
 
PPTX
Unified modelling language (UML)
Hirra Sultan
 
Processes
Hirra Sultan
 
report
Hirra Sultan
 
Presentation
Hirra Sultan
 
Superconductors And their Applications
Hirra Sultan
 
Attribute oriented analysis
Hirra Sultan
 
Control Flow Testing
Hirra Sultan
 
Monopolistic Competition
Hirra Sultan
 
Unified modelling language (UML)
Hirra Sultan
 

Recently uploaded (20)

PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Tally software_Introduction_Presentation
AditiBansal54083
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 

Inheritance in oops

  • 1. Sharda University Department Of Computer Science And Engineering School Of Engineering And Technology Greater Noida, U. P.
  • 2. Presented By Hirra Sultan CSE-B 2nd year Roll No. 120101091 Enrollment No. 2012017740 Supervisor: Mr. A. K. Sahoo [email protected]
  • 3. Introduction Background  The first OOP language designed for the first personal computer was smalltalk.  When OOP was integrated into C language, the resulting language was called C++ and it became the first object- oriented language to be widely used commercially.  Later java and other OOP languages were developed.
  • 4. Concept of Inheritance  Inheritance is that feature of an OOP language which allows reusability of code of a class and is considered corner stone of OOP languages.  Using inheritance, we can create a general class that defines traits common to a set of related items.  This class may then be inherited by other, more specific classes, each adding only those things that are unique to the inheriting class.
  • 5.  Base class: The class which gets inherited is called a base class. The code of this class is passed on to subclasses where it is reused.  Derived class: A subclass is a derived class which inherits the base class and uses its member functions.  Un-inheritable class: A class may be declared as un-inheritable by adding certain class modifiers to the class declaration before the "class" keyword and the class identifier declaration. Such sealed classes restrict reusability. Definitions
  • 6. Types of Inheritance  Single Inheritance: In single inheritance there is only one super class and only one sub class.  Multi-level inheritance: In multi-level inheritance a derived class is inherited by another class thus making multiple levels.
  • 7.  Multiple Inheritance: A class can inherit the attributes of two or more classes. This is known as multiple inheritance.  Hierarchical inheritance: When a base class is inherited by multiple derived classes it is called hierarchical inheritance.  Hybrid inheritance: This is a mixture of two or more inheritances in a single code.
  • 8. Inheritance may be derived in three forms which decides the way inherited data members can be used.  Public Inheritance: Public members of the base class become public members of the derived class and protected members of the base class become protected members of the derived class.
  • 9.  Protected Inheritance: When deriving from a protected base class, public and protected members of the base class become protected members of the derived class.  Private Inheritance: When deriving from a private base class, public and protected members of the base class become private members of the derived class.
  • 10. Inheritance in C++  In C++ all the five types of inheritances are applicable.  Friend functions and constructors can’t be inherited.  The general syntax of inheritance is: class derived-class-name : visibility-mode base- class-name { …// members of derived class };
  • 11. Inheritance in Java  The general syntax of inheritance is: Class Subclass-name extends superclass- name { //methods and fields }
  • 12.  The keyword extends indicates that we are making a new class that derives from an existing class.  Multiple and hybrid inheritance is not supported. This reduces the program complexity.  Constructors are not inherited by a subclass.
  • 13. Inheritance in Python  Instances inherit from classes, and classes inherit from super classes.  Python supports a limited form of multiple inheritance.  The syntax for inheritance in python is: class DerivedClassname (BaseClassName): <statement-1> . <statement-N>
  • 14. Inheritance in ADA  In Ada 95 terminology, types that can have parents or children are termed “tagged types”, and have the keyword “tagged” as part of their definition.  If we don't redefine a subprogram for a given type, the closest ancestor's defined subprogram will be used.
  • 15. Advantages  We save time because much of the code needed for our class is already written.  We can extend and revise a parent class without corrupting the existing parent class features.
  • 16. Disadvantages  Removing or swapping out a superclass will usually break subclasses.  It's inflexible.  Inheritance relationships generally can't be altered at runtime.