SlideShare a Scribd company logo
1 of 11
UNIT-III
Prepared by
R.RAJESWARI
Assistant Professor in IT Dept
S.B.K.COLLEGE
Object-Oriented Programming C++
Inheritance
class derived-class-name : visibility-mode base-class-name{
// ...
}
• three keywords: public, private, or protected
• determines how elements of the base class are inherited by the
derived class
Making a Private Member Inheritable
• Private member of a base class cannot be inherited
• Not available to derived class directly
• We can change private to public that will make accessible to all
other function.(There is no Data Hiding)
• C++ introduce third visibility modifier i.e., protected(limited
purpose in inheritance).
Protected
– accessible by the other member function within its class and
immediately derived class.
Protected
public mode private mode
1. accessible by derived class 1. accessible by derived class of
Of member function member function
2.Ready for further inheritance 2.not available for further inheritance
• Three keywords may appear in any order
Multilevel Inheritance
Intermediate
base class and
base class for
C
base class for
B
• B provide link
between A And
C
• The chain ABC
is known as
inheritance Path
Object-Oriented Programming C++inheritance types of inheritanceexampple program  .pptx

More Related Content

Similar to Object-Oriented Programming C++inheritance types of inheritanceexampple program .pptx

Access controlaspecifier and visibilty modes
Access controlaspecifier and visibilty modesAccess controlaspecifier and visibilty modes
Access controlaspecifier and visibilty modes
Vinay Kumar
 
A COMPLETE FILE FOR C++
A COMPLETE FILE FOR C++A COMPLETE FILE FOR C++
A COMPLETE FILE FOR C++
M Hussnain Ali
 

Similar to Object-Oriented Programming C++inheritance types of inheritanceexampple program .pptx (20)

Access controlaspecifier and visibilty modes
Access controlaspecifier and visibilty modesAccess controlaspecifier and visibilty modes
Access controlaspecifier and visibilty modes
 
lecture 6.pdf
lecture 6.pdflecture 6.pdf
lecture 6.pdf
 
C++ Object Oriented Programming
C++  Object Oriented ProgrammingC++  Object Oriented Programming
C++ Object Oriented Programming
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
C++ Notes
C++ NotesC++ Notes
C++ Notes
 
inheritance
inheritanceinheritance
inheritance
 
Lecturespecial
LecturespecialLecturespecial
Lecturespecial
 
OOP
OOPOOP
OOP
 
CLASSES AND OBJECTS IN C++ +2 COMPUTER SCIENCE
CLASSES AND OBJECTS IN C++ +2 COMPUTER SCIENCECLASSES AND OBJECTS IN C++ +2 COMPUTER SCIENCE
CLASSES AND OBJECTS IN C++ +2 COMPUTER SCIENCE
 
OOP Unit 2 - Classes and Object
OOP Unit 2 - Classes and ObjectOOP Unit 2 - Classes and Object
OOP Unit 2 - Classes and Object
 
A COMPLETE FILE FOR C++
A COMPLETE FILE FOR C++A COMPLETE FILE FOR C++
A COMPLETE FILE FOR C++
 
Inheritance in c++ part1
Inheritance in c++ part1Inheritance in c++ part1
Inheritance in c++ part1
 
Inheritance
InheritanceInheritance
Inheritance
 
OOPs & C++ UNIT 3
OOPs & C++ UNIT 3OOPs & C++ UNIT 3
OOPs & C++ UNIT 3
 
Presentation on class and object in Object Oriented programming.
Presentation on class and object in Object Oriented programming.Presentation on class and object in Object Oriented programming.
Presentation on class and object in Object Oriented programming.
 
Inheritance.pptx
Inheritance.pptxInheritance.pptx
Inheritance.pptx
 
Python .pptx
Python .pptxPython .pptx
Python .pptx
 
Lecture 2 (1)
Lecture 2 (1)Lecture 2 (1)
Lecture 2 (1)
 
OBJECT ORIENTED PROGRAMING IN C++
OBJECT ORIENTED PROGRAMING IN C++ OBJECT ORIENTED PROGRAMING IN C++
OBJECT ORIENTED PROGRAMING IN C++
 
week14 (1).ppt
week14 (1).pptweek14 (1).ppt
week14 (1).ppt
 

More from Rajes Wari (7)

c++ INTRODUCTION SOFTWARE CROISIS TYPES OF PRO
c++ INTRODUCTION SOFTWARE CROISIS TYPES OF PROc++ INTRODUCTION SOFTWARE CROISIS TYPES OF PRO
c++ INTRODUCTION SOFTWARE CROISIS TYPES OF PRO
 
10.8.2018
10.8.201810.8.2018
10.8.2018
 
12.7.2018
12.7.201812.7.2018
12.7.2018
 
11.3.14&22.1.16
11.3.14&22.1.1611.3.14&22.1.16
11.3.14&22.1.16
 
4.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.154.7.14&17.7.14&23.6.15&10.9.15
4.7.14&17.7.14&23.6.15&10.9.15
 
25.2.14
25.2.1425.2.14
25.2.14
 
18.2.14
18.2.1418.2.14
18.2.14
 

Recently uploaded

CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
Wonjun Hwang
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 

Recently uploaded (20)

Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 

Object-Oriented Programming C++inheritance types of inheritanceexampple program .pptx

  • 1. UNIT-III Prepared by R.RAJESWARI Assistant Professor in IT Dept S.B.K.COLLEGE Object-Oriented Programming C++
  • 2. Inheritance class derived-class-name : visibility-mode base-class-name{ // ... } • three keywords: public, private, or protected • determines how elements of the base class are inherited by the derived class
  • 3. Making a Private Member Inheritable • Private member of a base class cannot be inherited • Not available to derived class directly • We can change private to public that will make accessible to all other function.(There is no Data Hiding) • C++ introduce third visibility modifier i.e., protected(limited purpose in inheritance). Protected – accessible by the other member function within its class and immediately derived class.
  • 4. Protected public mode private mode 1. accessible by derived class 1. accessible by derived class of Of member function member function 2.Ready for further inheritance 2.not available for further inheritance
  • 5.
  • 6. • Three keywords may appear in any order
  • 7.
  • 8.
  • 9.
  • 10. Multilevel Inheritance Intermediate base class and base class for C base class for B • B provide link between A And C • The chain ABC is known as inheritance Path