SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

Inheritance ppt
Inheritance pptInheritance ppt
Inheritance ppt
Nivegeetha
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
Vishal Patil
 
class and objects
class and objectsclass and objects
class and objects
Payel Guria
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
HalaiHansaika
 
Inheritance in Object Oriented Programming
Inheritance in Object Oriented ProgrammingInheritance in Object Oriented Programming
Inheritance in Object Oriented Programming
Ashita Agrawal
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions
Muhammad Hammad Waseem
 
Friend function
Friend functionFriend function
Friend function
zindadili
 
Virtual base class
Virtual base classVirtual base class
Virtual base class
Tech_MX
 
inheritance
inheritanceinheritance
inheritance
Nivetha Elangovan
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
Vineeta Garg
 
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
 
Access specifier
Access specifierAccess specifier
Access specifier
zindadili
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
Tech_MX
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
Shubham Dwivedi
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPT
Pooja Jaiswal
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
MOHIT AGARWAL
 
Function overloading and overriding
Function overloading and overridingFunction overloading and overriding
Function overloading and overriding
Rajab Ali
 
Inline function
Inline functionInline function
Inline function
Tech_MX
 
Encapsulation C++
Encapsulation C++Encapsulation C++
Encapsulation C++
Hashim Hashim
 
Inheritance ppt
Inheritance pptInheritance ppt
Inheritance ppt
Nivegeetha
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
Vishal Patil
 
class and objects
class and objectsclass and objects
class and objects
Payel Guria
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
HalaiHansaika
 
Inheritance in Object Oriented Programming
Inheritance in Object Oriented ProgrammingInheritance in Object Oriented Programming
Inheritance in Object Oriented Programming
Ashita Agrawal
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions
Muhammad Hammad Waseem
 
Friend function
Friend functionFriend function
Friend function
zindadili
 
Virtual base class
Virtual base classVirtual base class
Virtual base class
Tech_MX
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
Vineeta Garg
 
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
 
Access specifier
Access specifierAccess specifier
Access specifier
zindadili
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
Tech_MX
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
Shubham Dwivedi
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
Michelle Anne Meralpis
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPT
Pooja Jaiswal
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
MOHIT AGARWAL
 
Function overloading and overriding
Function overloading and overridingFunction overloading and overriding
Function overloading and overriding
Rajab Ali
 
Inline function
Inline functionInline function
Inline function
Tech_MX
 

Viewers also liked (20)

Inheritance, Object Oriented Programming
Inheritance, Object Oriented ProgrammingInheritance, Object Oriented Programming
Inheritance, Object Oriented Programming
Arslan Waseem
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++
Laxman Puri
 
Inheritance
InheritanceInheritance
Inheritance
Selvin Josy Bai Somu
 
inheritance c++
inheritance c++inheritance c++
inheritance c++
Muraleedhar Sundararajan
 
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
cprogrammings
 
Oops ppt
Oops pptOops ppt
Oops ppt
abhayjuneja
 
C++ Inheritance
C++ InheritanceC++ Inheritance
C++ Inheritance
Jussi Pohjolainen
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
thinkphp
 
Constructors & destructors
Constructors & destructorsConstructors & destructors
Constructors & destructors
ForwardBlog Enewzletter
 
Inheritance
InheritanceInheritance
Inheritance
Tech_MX
 
Constructor & destructor
Constructor & destructorConstructor & destructor
Constructor & destructor
Saharsh Anand
 
Inheritance
InheritanceInheritance
Inheritance
poonam.rwalia
 
Inheritance
InheritanceInheritance
Inheritance
Srinath Dhayalamoorthy
 
Types of Inheritance
Types of InheritanceTypes of Inheritance
Types of Inheritance
Kimmer Collison-Ris
 
Constructors and Destructors
Constructors and DestructorsConstructors and Destructors
Constructors and Destructors
Dr Sukhpal Singh Gill
 
Constructor & Destructor
Constructor & DestructorConstructor & Destructor
Constructor & Destructor
KV(AFS) Utarlai, Barmer (Rajasthan)
 
Constructor ppt
Constructor pptConstructor ppt
Constructor ppt
Vinod Kumar
 
Inheritance OOP Concept in C++.
Inheritance OOP Concept in C++.Inheritance OOP Concept in C++.
Inheritance OOP Concept in C++.
MASQ Technologies
 
Csharp4 inheritance
Csharp4 inheritanceCsharp4 inheritance
Csharp4 inheritance
Abed Bukhari
 
4GMAT Diagnostic Test Q14 - Problem Solving - Coordinate Geometry
4GMAT Diagnostic Test Q14 - Problem Solving - Coordinate Geometry4GMAT Diagnostic Test Q14 - Problem Solving - Coordinate Geometry
4GMAT Diagnostic Test Q14 - Problem Solving - Coordinate Geometry
4gmatprep
 
Ad

Similar to Inheritance in oops (20)

Final presentation programming
Final presentation programmingFinal presentation programming
Final presentation programming
haider ali
 
lecture 6.pdf
lecture 6.pdflecture 6.pdf
lecture 6.pdf
WaqarRaj1
 
java_vyshali.pdf
java_vyshali.pdfjava_vyshali.pdf
java_vyshali.pdf
Vyshali6
 
C++ Inheritance.pptx
C++ Inheritance.pptxC++ Inheritance.pptx
C++ Inheritance.pptx
XanGwaps
 
TYPES OF INHERITANCE CONCEPT IN C++.pptx
TYPES OF INHERITANCE CONCEPT IN C++.pptxTYPES OF INHERITANCE CONCEPT IN C++.pptx
TYPES OF INHERITANCE CONCEPT IN C++.pptx
SPECIALISESPECIALISE
 
Inheritance in C++ (Programming Fundamentals)
Inheritance in C++ (Programming Fundamentals)Inheritance in C++ (Programming Fundamentals)
Inheritance in C++ (Programming Fundamentals)
Home
 
Inheritance
InheritanceInheritance
Inheritance
Aadhi Aadhithya
 
inheritance
inheritanceinheritance
inheritance
Amir_Mukhtar
 
Inheritance
InheritanceInheritance
Inheritance
Pranali Chaudhari
 
OOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdfOOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdf
Anant240318
 
Inheritance
InheritanceInheritance
Inheritance
prashant prath
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
talha ijaz
 
Programming Lesson by Slidesgo.pptx
Programming Lesson by Slidesgo.pptxProgramming Lesson by Slidesgo.pptx
Programming Lesson by Slidesgo.pptx
DilanAlmsa
 
Inheritance in java.pptx_20241025_101324_0000.pptx.pptx
Inheritance in java.pptx_20241025_101324_0000.pptx.pptxInheritance in java.pptx_20241025_101324_0000.pptx.pptx
Inheritance in java.pptx_20241025_101324_0000.pptx.pptx
saurabhthege
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
Debasish Pratihari
 
Inheritance
InheritanceInheritance
Inheritance
disha singh
 
Java - Inheritance Concepts
Java - Inheritance ConceptsJava - Inheritance Concepts
Java - Inheritance Concepts
Victer Paul
 
Opp concept in c++
Opp concept in c++Opp concept in c++
Opp concept in c++
SadiqullahGhani1
 
Inheritance in Java - An Introduction & types
Inheritance in Java - An Introduction & typesInheritance in Java - An Introduction & types
Inheritance in Java - An Introduction & types
VijethaChandran
 
Inheritance
InheritanceInheritance
Inheritance
Amit Dixit
 
Final presentation programming
Final presentation programmingFinal presentation programming
Final presentation programming
haider ali
 
lecture 6.pdf
lecture 6.pdflecture 6.pdf
lecture 6.pdf
WaqarRaj1
 
java_vyshali.pdf
java_vyshali.pdfjava_vyshali.pdf
java_vyshali.pdf
Vyshali6
 
C++ Inheritance.pptx
C++ Inheritance.pptxC++ Inheritance.pptx
C++ Inheritance.pptx
XanGwaps
 
TYPES OF INHERITANCE CONCEPT IN C++.pptx
TYPES OF INHERITANCE CONCEPT IN C++.pptxTYPES OF INHERITANCE CONCEPT IN C++.pptx
TYPES OF INHERITANCE CONCEPT IN C++.pptx
SPECIALISESPECIALISE
 
Inheritance in C++ (Programming Fundamentals)
Inheritance in C++ (Programming Fundamentals)Inheritance in C++ (Programming Fundamentals)
Inheritance in C++ (Programming Fundamentals)
Home
 
OOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdfOOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdf
Anant240318
 
Programming Lesson by Slidesgo.pptx
Programming Lesson by Slidesgo.pptxProgramming Lesson by Slidesgo.pptx
Programming Lesson by Slidesgo.pptx
DilanAlmsa
 
Inheritance in java.pptx_20241025_101324_0000.pptx.pptx
Inheritance in java.pptx_20241025_101324_0000.pptx.pptxInheritance in java.pptx_20241025_101324_0000.pptx.pptx
Inheritance in java.pptx_20241025_101324_0000.pptx.pptx
saurabhthege
 
Java - Inheritance Concepts
Java - Inheritance ConceptsJava - Inheritance Concepts
Java - Inheritance Concepts
Victer Paul
 
Inheritance in Java - An Introduction & types
Inheritance in Java - An Introduction & typesInheritance in Java - An Introduction & types
Inheritance in Java - An Introduction & types
VijethaChandran
 
Ad

More from Hirra Sultan (8)

Processes
ProcessesProcesses
Processes
Hirra Sultan
 
report
reportreport
report
Hirra Sultan
 
Presentation
PresentationPresentation
Presentation
Hirra Sultan
 
Superconductors And their Applications
Superconductors And their ApplicationsSuperconductors And their Applications
Superconductors And their Applications
Hirra Sultan
 
Attribute oriented analysis
Attribute oriented analysisAttribute oriented analysis
Attribute oriented analysis
Hirra Sultan
 
Control Flow Testing
Control Flow TestingControl Flow Testing
Control Flow Testing
Hirra Sultan
 
Monopolistic Competition
Monopolistic CompetitionMonopolistic Competition
Monopolistic Competition
Hirra Sultan
 
Unified modelling language (UML)
Unified modelling language (UML)Unified modelling language (UML)
Unified modelling language (UML)
Hirra Sultan
 
Superconductors And their Applications
Superconductors And their ApplicationsSuperconductors And their Applications
Superconductors And their Applications
Hirra Sultan
 
Attribute oriented analysis
Attribute oriented analysisAttribute oriented analysis
Attribute oriented analysis
Hirra Sultan
 
Control Flow Testing
Control Flow TestingControl Flow Testing
Control Flow Testing
Hirra Sultan
 
Monopolistic Competition
Monopolistic CompetitionMonopolistic Competition
Monopolistic Competition
Hirra Sultan
 
Unified modelling language (UML)
Unified modelling language (UML)Unified modelling language (UML)
Unified modelling language (UML)
Hirra Sultan
 

Recently uploaded (20)

Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.pptPassive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
IES VE
 
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studiesTroubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Tier1 app
 
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdfProtect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
株式会社クライム
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World ExamplesMastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
Exchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv SoftwareExchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv Software
Shoviv Software
 
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
OnePlan Solutions
 
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint PresentationFrom Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
Shay Ginsbourg
 
AEM User Group DACH - 2025 Inaugural Meeting
AEM User Group DACH - 2025 Inaugural MeetingAEM User Group DACH - 2025 Inaugural Meeting
AEM User Group DACH - 2025 Inaugural Meeting
jennaf3
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025
Phil Eaton
 
Adobe Media Encoder Crack FREE Download 2025
Adobe Media Encoder  Crack FREE Download 2025Adobe Media Encoder  Crack FREE Download 2025
Adobe Media Encoder Crack FREE Download 2025
zafranwaqar90
 
Buy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training techBuy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training tech
Rustici Software
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025
Web Designer
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEMGDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
philipnathen82
 
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.pptPassive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
IES VE
 
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studiesTroubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Tier1 app
 
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdfProtect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
株式会社クライム
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World ExamplesMastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
Exchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv SoftwareExchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv Software
Shoviv Software
 
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
OnePlan Solutions
 
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint PresentationFrom Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
Shay Ginsbourg
 
AEM User Group DACH - 2025 Inaugural Meeting
AEM User Group DACH - 2025 Inaugural MeetingAEM User Group DACH - 2025 Inaugural Meeting
AEM User Group DACH - 2025 Inaugural Meeting
jennaf3
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025
Phil Eaton
 
Adobe Media Encoder Crack FREE Download 2025
Adobe Media Encoder  Crack FREE Download 2025Adobe Media Encoder  Crack FREE Download 2025
Adobe Media Encoder Crack FREE Download 2025
zafranwaqar90
 
Buy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training techBuy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training tech
Rustici Software
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025
Web Designer
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEMGDS SYSTEM | GLOBAL  DISTRIBUTION SYSTEM
GDS SYSTEM | GLOBAL DISTRIBUTION SYSTEM
philipnathen82
 

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 prlhirr@gmail.com
  • 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.
  翻译: