SlideShare a Scribd company logo
1 of 22
Need for inheritance:
one basic reason behind this is the
the capability to express the
inheritance relationship.
Another reason is the idea of
reusability
one reason is transitive nature of
of inheritance
inheritance:
some time we need to repeat the code
or we need to repeat the whole class
properties. So it helps in various ways
it saves memory space
it saves time
it will remove frustration
it increase reliability of the code
it saves the developing and testing
efforts
Why we use inheritance?
To increase the reusability of the
the code and to make future usable
usable for another classes.
we use the concept of inheritance
How inheritance can be
achieved?
In the inheritance there will be a
a parent child relationship. There is
There is a class called in which all
all the properties are defined and
and generally, it is refered as a
base class. There is also another
another class in which is derived
derived from the existing one are
are known as a derived class.
Inheritance Access Specifiers
Public Inheritance
This inheritance mode is used
mostly. In this the protected
member of Base class becomes
protected members of Derived class
class and public becomes public.
Inheritance Access Specifiers
Protected Inheritance
In protected mode, the public and
and protected members of Base
class becomes protected members
members of Derived class.
class B : protected A
class C : protected B
Inheritance Access Specifiers
Private Inheritance
In private mode the public and
protected members of Base class
class become private members of
of Derived class.
class B : private A
class C : private B
Types of inheritance
There are different types of inheritance
inheritance
single inheritance
Multiple inheritance
Hierarchical inheritance
multilevel inheritance
hybrid inheritance
Single inheritance enables a
derived class to inherit properties
properties and behavior from a
single parent class. It allows a
derived class to inherit the
properties and behavior of a base
base class, thus enabling code
reusability as well as adding new
new features to the existing code.
code.
syntax
class A
{
-------
-------
};
class D : access specifier A
{
-------
-------
};
Derived class
In Inheritance you create new
classes from existing class. Any
new class that you create from an
an existing class is called derived
derived class.
Base class
existing class is called base class.
class.
SOURCE CODE
OUTPUT:
POSITION=0
POSITION=1
POSITION=0
Final presentation programming

More Related Content

What's hot (19)

Inheritance
InheritanceInheritance
Inheritance
 
Inheritance
InheritanceInheritance
Inheritance
 
Inheritance
InheritanceInheritance
Inheritance
 
inheritance
inheritanceinheritance
inheritance
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
Inheritance in c++ part1
Inheritance in c++ part1Inheritance in c++ part1
Inheritance in c++ part1
 
Inheritance,constructor,friend function
Inheritance,constructor,friend functionInheritance,constructor,friend function
Inheritance,constructor,friend function
 
Introduction to Inheritance
Introduction to InheritanceIntroduction to Inheritance
Introduction to Inheritance
 
Single inheritance
Single inheritanceSingle inheritance
Single inheritance
 
Inheritance
InheritanceInheritance
Inheritance
 
Inheritance
InheritanceInheritance
Inheritance
 
10 access control
10   access control10   access control
10 access control
 
Access specifiers(modifiers) in java
Access specifiers(modifiers) in javaAccess specifiers(modifiers) in java
Access specifiers(modifiers) in java
 
Access modifier and inheritance
Access modifier and inheritanceAccess modifier and inheritance
Access modifier and inheritance
 
Inheritance In C++ (Object Oriented Programming)
Inheritance In C++ (Object Oriented Programming)Inheritance In C++ (Object Oriented Programming)
Inheritance In C++ (Object Oriented Programming)
 
Inheritance
InheritanceInheritance
Inheritance
 
inheritance
   inheritance   inheritance
inheritance
 
Java - Inheritance Concepts
Java - Inheritance ConceptsJava - Inheritance Concepts
Java - Inheritance Concepts
 

Viewers also liked

Actividad de aprendizaje 2
Actividad de aprendizaje 2Actividad de aprendizaje 2
Actividad de aprendizaje 2celia solis
 
Cuestionario diagnostico (presentacion)
Cuestionario diagnostico (presentacion)Cuestionario diagnostico (presentacion)
Cuestionario diagnostico (presentacion)juan Ibarra
 
English parts of speech
English parts of speech English parts of speech
English parts of speech haider ali
 
Hands on robotics in coimbatore
Hands on robotics in coimbatoreHands on robotics in coimbatore
Hands on robotics in coimbatorehandsonroboticsoff
 
Fundamentals of information technology
Fundamentals       of          information   technologyFundamentals       of          information   technology
Fundamentals of information technologyhaider ali
 
Non – verbal communication (1)
Non – verbal communication (1)Non – verbal communication (1)
Non – verbal communication (1)haider ali
 
Chapter 5 input
Chapter 5   inputChapter 5   input
Chapter 5 inputhaider ali
 
Chapter 9 communications and networks
Chapter 9   communications and networksChapter 9   communications and networks
Chapter 9 communications and networkshaider ali
 

Viewers also liked (12)

Actividad de aprendizaje 2
Actividad de aprendizaje 2Actividad de aprendizaje 2
Actividad de aprendizaje 2
 
Caso de Ts
Caso de TsCaso de Ts
Caso de Ts
 
Cuestionario diagnostico (presentacion)
Cuestionario diagnostico (presentacion)Cuestionario diagnostico (presentacion)
Cuestionario diagnostico (presentacion)
 
English parts of speech
English parts of speech English parts of speech
English parts of speech
 
Hands on robotics in coimbatore
Hands on robotics in coimbatoreHands on robotics in coimbatore
Hands on robotics in coimbatore
 
Concepto de modelo en ts
Concepto de modelo en tsConcepto de modelo en ts
Concepto de modelo en ts
 
Fundamentals of information technology
Fundamentals       of          information   technologyFundamentals       of          information   technology
Fundamentals of information technology
 
Presentation1
Presentation1Presentation1
Presentation1
 
Non – verbal communication (1)
Non – verbal communication (1)Non – verbal communication (1)
Non – verbal communication (1)
 
Chapter 5 input
Chapter 5   inputChapter 5   input
Chapter 5 input
 
Chapter 9 communications and networks
Chapter 9   communications and networksChapter 9   communications and networks
Chapter 9 communications and networks
 
Resume
ResumeResume
Resume
 

Similar to Final presentation programming

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
 
Programming presentation
Programming presentationProgramming presentation
Programming presentationhaider ali
 
OOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdfOOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdfAnant240318
 
lecture 6.pdf
lecture 6.pdflecture 6.pdf
lecture 6.pdfWaqarRaj1
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++Shweta Shah
 
E -COMMERCE.ppt
E -COMMERCE.pptE -COMMERCE.ppt
E -COMMERCE.pptclassall
 
Inheritance and its types In Java
Inheritance and its types In JavaInheritance and its types In Java
Inheritance and its types In JavaMD SALEEM QAISAR
 
java_vyshali.pdf
java_vyshali.pdfjava_vyshali.pdf
java_vyshali.pdfVyshali6
 
inheritance-16031525566nbhij56604452.pdf
inheritance-16031525566nbhij56604452.pdfinheritance-16031525566nbhij56604452.pdf
inheritance-16031525566nbhij56604452.pdfkashafishfaq21
 
C++ Inheritance.pptx
C++ Inheritance.pptxC++ Inheritance.pptx
C++ Inheritance.pptxXanGwaps
 
Inheritance OOP Concept in C++.
Inheritance OOP Concept in C++.Inheritance OOP Concept in C++.
Inheritance OOP Concept in C++.MASQ Technologies
 
Mca 2nd sem u-3 inheritance
Mca 2nd  sem u-3 inheritanceMca 2nd  sem u-3 inheritance
Mca 2nd sem u-3 inheritanceRai University
 
Bca 2nd sem u-3 inheritance
Bca 2nd sem u-3 inheritanceBca 2nd sem u-3 inheritance
Bca 2nd sem u-3 inheritanceRai University
 
Chapter25 inheritance-i
Chapter25 inheritance-iChapter25 inheritance-i
Chapter25 inheritance-iDeepak Singh
 
Introduction to Inheritance in Java for presentation
Introduction to Inheritance in Java for presentationIntroduction to Inheritance in Java for presentation
Introduction to Inheritance in Java for presentationBhanuPrakashChirra
 

Similar to Final presentation programming (20)

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...
 
Programming presentation
Programming presentationProgramming presentation
Programming presentation
 
OOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdfOOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdf
 
lecture 6.pdf
lecture 6.pdflecture 6.pdf
lecture 6.pdf
 
INHERITANCE-Oopc ppt-ta4
INHERITANCE-Oopc ppt-ta4INHERITANCE-Oopc ppt-ta4
INHERITANCE-Oopc ppt-ta4
 
Inheritance
InheritanceInheritance
Inheritance
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++
 
E -COMMERCE.ppt
E -COMMERCE.pptE -COMMERCE.ppt
E -COMMERCE.ppt
 
Inheritance
Inheritance Inheritance
Inheritance
 
Inheritance and its types In Java
Inheritance and its types In JavaInheritance and its types In Java
Inheritance and its types In Java
 
java_vyshali.pdf
java_vyshali.pdfjava_vyshali.pdf
java_vyshali.pdf
 
Ganesh groups
Ganesh groupsGanesh groups
Ganesh groups
 
inheritance-16031525566nbhij56604452.pdf
inheritance-16031525566nbhij56604452.pdfinheritance-16031525566nbhij56604452.pdf
inheritance-16031525566nbhij56604452.pdf
 
C++ Inheritance.pptx
C++ Inheritance.pptxC++ Inheritance.pptx
C++ Inheritance.pptx
 
Python-Inheritance.pptx
Python-Inheritance.pptxPython-Inheritance.pptx
Python-Inheritance.pptx
 
Inheritance OOP Concept in C++.
Inheritance OOP Concept in C++.Inheritance OOP Concept in C++.
Inheritance OOP Concept in C++.
 
Mca 2nd sem u-3 inheritance
Mca 2nd  sem u-3 inheritanceMca 2nd  sem u-3 inheritance
Mca 2nd sem u-3 inheritance
 
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
 
Introduction to Inheritance in Java for presentation
Introduction to Inheritance in Java for presentationIntroduction to Inheritance in Java for presentation
Introduction to Inheritance in Java for presentation
 

More from haider ali

Upwork freelancer guide
Upwork freelancer guideUpwork freelancer guide
Upwork freelancer guidehaider ali
 
Chapter 13 programming languages and program development
Chapter 13   programming languages and program developmentChapter 13   programming languages and program development
Chapter 13 programming languages and program developmenthaider ali
 
Chapter 12 information system development
Chapter 12   information system developmentChapter 12   information system development
Chapter 12 information system developmenthaider ali
 
Chapter 11 computer security and safety, ethics, and privacy
Chapter 11   computer security and safety, ethics, and privacyChapter 11   computer security and safety, ethics, and privacy
Chapter 11 computer security and safety, ethics, and privacyhaider ali
 
Chapter 10 database management
Chapter 10   database managementChapter 10   database management
Chapter 10 database managementhaider ali
 
Chapter 8 operating systems and utility programs
Chapter 8   operating systems and utility programsChapter 8   operating systems and utility programs
Chapter 8 operating systems and utility programshaider ali
 
Chapter 6 output
Chapter 6   outputChapter 6   output
Chapter 6 outputhaider ali
 
Chapter 4 the components of the system unit
Chapter 4   the components of the system unitChapter 4   the components of the system unit
Chapter 4 the components of the system unithaider ali
 
Chapter 3 application software
Chapter 3   application softwareChapter 3   application software
Chapter 3 application softwarehaider ali
 
Modalauxiliaries 1
Modalauxiliaries 1Modalauxiliaries 1
Modalauxiliaries 1haider ali
 
Teaching tenses
Teaching tensesTeaching tenses
Teaching tenseshaider ali
 
Parts of speech
Parts of speechParts of speech
Parts of speechhaider ali
 
How to configure an operating system
How to configure an operating systemHow to configure an operating system
How to configure an operating systemhaider ali
 
Chapter 2 the internet and world wide web
Chapter 2   the internet and world wide webChapter 2   the internet and world wide web
Chapter 2 the internet and world wide webhaider ali
 
Chapter 1 introduction to computers
Chapter 1   introduction to computersChapter 1   introduction to computers
Chapter 1 introduction to computershaider ali
 
Parts of-speech
Parts of-speech Parts of-speech
Parts of-speech haider ali
 
Communication devices
Communication devicesCommunication devices
Communication deviceshaider ali
 
Fundamental of Information Technology
Fundamental of Information Technology Fundamental of Information Technology
Fundamental of Information Technology haider ali
 
Business in education
Business in educationBusiness in education
Business in educationhaider ali
 

More from haider ali (20)

Upwork freelancer guide
Upwork freelancer guideUpwork freelancer guide
Upwork freelancer guide
 
Chapter 13 programming languages and program development
Chapter 13   programming languages and program developmentChapter 13   programming languages and program development
Chapter 13 programming languages and program development
 
Chapter 12 information system development
Chapter 12   information system developmentChapter 12   information system development
Chapter 12 information system development
 
Chapter 11 computer security and safety, ethics, and privacy
Chapter 11   computer security and safety, ethics, and privacyChapter 11   computer security and safety, ethics, and privacy
Chapter 11 computer security and safety, ethics, and privacy
 
Chapter 10 database management
Chapter 10   database managementChapter 10   database management
Chapter 10 database management
 
Chapter 8 operating systems and utility programs
Chapter 8   operating systems and utility programsChapter 8   operating systems and utility programs
Chapter 8 operating systems and utility programs
 
Chapter 6 output
Chapter 6   outputChapter 6   output
Chapter 6 output
 
Chapter 4 the components of the system unit
Chapter 4   the components of the system unitChapter 4   the components of the system unit
Chapter 4 the components of the system unit
 
Chapter 3 application software
Chapter 3   application softwareChapter 3   application software
Chapter 3 application software
 
Modalauxiliaries 1
Modalauxiliaries 1Modalauxiliaries 1
Modalauxiliaries 1
 
Teaching tenses
Teaching tensesTeaching tenses
Teaching tenses
 
Tenses
TensesTenses
Tenses
 
Parts of speech
Parts of speechParts of speech
Parts of speech
 
How to configure an operating system
How to configure an operating systemHow to configure an operating system
How to configure an operating system
 
Chapter 2 the internet and world wide web
Chapter 2   the internet and world wide webChapter 2   the internet and world wide web
Chapter 2 the internet and world wide web
 
Chapter 1 introduction to computers
Chapter 1   introduction to computersChapter 1   introduction to computers
Chapter 1 introduction to computers
 
Parts of-speech
Parts of-speech Parts of-speech
Parts of-speech
 
Communication devices
Communication devicesCommunication devices
Communication devices
 
Fundamental of Information Technology
Fundamental of Information Technology Fundamental of Information Technology
Fundamental of Information Technology
 
Business in education
Business in educationBusiness in education
Business in education
 

Recently uploaded

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 

Recently uploaded (20)

EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 

Final presentation programming

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. Need for inheritance: one basic reason behind this is the the capability to express the inheritance relationship. Another reason is the idea of reusability one reason is transitive nature of of inheritance
  • 7. inheritance: some time we need to repeat the code or we need to repeat the whole class properties. So it helps in various ways it saves memory space it saves time it will remove frustration it increase reliability of the code it saves the developing and testing efforts
  • 8. Why we use inheritance? To increase the reusability of the the code and to make future usable usable for another classes. we use the concept of inheritance
  • 9. How inheritance can be achieved? In the inheritance there will be a a parent child relationship. There is There is a class called in which all all the properties are defined and and generally, it is refered as a base class. There is also another another class in which is derived derived from the existing one are are known as a derived class.
  • 10. Inheritance Access Specifiers Public Inheritance This inheritance mode is used mostly. In this the protected member of Base class becomes protected members of Derived class class and public becomes public.
  • 11. Inheritance Access Specifiers Protected Inheritance In protected mode, the public and and protected members of Base class becomes protected members members of Derived class. class B : protected A class C : protected B
  • 12. Inheritance Access Specifiers Private Inheritance In private mode the public and protected members of Base class class become private members of of Derived class. class B : private A class C : private B
  • 13. Types of inheritance There are different types of inheritance inheritance single inheritance Multiple inheritance Hierarchical inheritance multilevel inheritance hybrid inheritance
  • 14. Single inheritance enables a derived class to inherit properties properties and behavior from a single parent class. It allows a derived class to inherit the properties and behavior of a base base class, thus enabling code reusability as well as adding new new features to the existing code. code.
  • 15. syntax class A { ------- ------- }; class D : access specifier A { ------- ------- };
  • 16.
  • 17. Derived class In Inheritance you create new classes from existing class. Any new class that you create from an an existing class is called derived derived class. Base class existing class is called base class. class.
  • 19.
  • 20.