SlideShare a Scribd company logo
Object Oriented
Programming
Introduction to oop
• Object-oriented programming (OOP) is a programming paradigm
using "objects" – data structures consisting of data fields and
methods together with their interactions – to design applications and
computer programs. Programming techniques may include features
such as data abstraction, encapsulation, messaging, modularity,
polymorphism, and inheritance. Many modern programming
languages now support OOP.
Programming paradigm :
A programming paradigm is a fundamental style
of computer programming. Paradigms differ in
the concepts and abstractions used to
represent the elements of a program (such as
objects, functions, variables, constraints, etc.)
and the steps that compose a computation
(assignment, evaluation, continuations, data
flows, etc.).
Classes:
In object-oriented programming, a class is a construct that is used as
a blueprint to create instances of the class (class instances, class
objects, instance objects or just objects). A class defines
constituent members which enable class instances to have state and
behavior. Data field members (member variables or instance
variables) enable a class object to maintain state. Other kinds of
members, especially methods, enable a class object's behavior. Class
instances are of the type of the associated class.
For example, an instance of the class "Fruit" (a "Fruit" object) would
be of the type "Fruit". A class usually represents a noun, such as a
person, place or (possibly quite abstract) thing. Programming
languages that include classes as a programming construct subtly
differ in their support for various class-related features. Most
support various forms of class inheritance. Many languages also
support advanced encapsulation control features, such as access
specifiers.
Object:
Object is an run time entity.
Is an Instance of class
Represents a Place ,Person ,anything that have
some attributes.
Objects and Instances:
There is a very important distinction between an
object and an instance of an object. An object is
actually a definition, or a template for instances
of that object. An instance of an object is an
actual thing that can be manipulated. For
instance, we could define a Person object, which
may include such member data as hair color, eye
color, height, weight, etc. An instance of this
object could be "Dave" and Dave has values for
hair color, eye color, etc. This allows for multiple
instances of an object to be created.
Data Encapsulation and Abstraction:
Data encapsulation, sometimes referred to as data hiding.
Data Encapsulation and Data Abstraction is one of the most striking
feature of object oriented programming.
The wrapping up of data and code into a single unit is called data
encapsulation. The data is not accessible to the outside world only
those functions which are wrapped into a class can only access the
private data of the class.
Contd…
The concept of data encapsulation is supported in C++
through the use of the public, protected and private
keywords which are placed in the declaration of the class.
Note :
Anything in the class placed after the public keyword is
accessible to all the users of the class
Elements placed after the protected keyword are
accessible only to the methods of the class or classes
derived from that class
Elements placed after the private keyword are
accessible only to the methods of the class.
Inheritance :
Inheritance is one of the most striking feature of
object oriented programming.
Inheritance is the process by which one class can
acquire the properties of another class.
The new classes, known as subclasses (or derived
classes), inherit attributes and behavior of the
pre-existing classes, which are referred to as
superclasses (or ancestor classes). The inheritance
relationships of classes gives rise to a hierarchy
Contd…
A superclass, base class, or parent class is a
class from which other classes are derived.
The classes that are derived from a superclass
are known as child classes, derived classes,
or subclasses.
In object-oriented programming (OOP),
inheritance is a way to compartmentalize and
reuse code by creating collections of
attributes and behaviors called objects
which can be based on previously created
objects.

More Related Content

Similar to Object Oriented Programming Language is an oop (20)

Oops concepts
Oops conceptsOops concepts
Oops concepts
ACCESS Health Digital
 
Oops
OopsOops
Oops
PRABHAHARAN429
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
object oriented programming and methodology.pptx
object oriented programming and methodology.pptxobject oriented programming and methodology.pptx
object oriented programming and methodology.pptx
ayush626953
 
Overview of Object Oriented Programming using C++
Overview of Object Oriented Programming using C++Overview of Object Oriented Programming using C++
Overview of Object Oriented Programming using C++
jayanthi699330
 
INTRODUCTION AND BASIC CONCEPT OF OOAD.pptx
INTRODUCTION AND BASIC CONCEPT OF OOAD.pptxINTRODUCTION AND BASIC CONCEPT OF OOAD.pptx
INTRODUCTION AND BASIC CONCEPT OF OOAD.pptx
hewor74970
 
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtapOverview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
Vikas Jagtap
 
Objects oriented programming concepts.docx
Objects oriented programming concepts.docxObjects oriented programming concepts.docx
Objects oriented programming concepts.docx
JSEThomasR
 
OOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptxOOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptx
ShobhitSrivastava15887
 
OOP.pptx
OOP.pptxOOP.pptx
OOP.pptx
ashmitsen2005
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
Kanan Gandhi
 
Programming paradigm.ppt
Programming paradigm.pptProgramming paradigm.ppt
Programming paradigm.ppt
IKATrainingCentre
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
JITTAYASHWANTHREDDY
 
Oops
OopsOops
Oops
Sankar Balasubramanian
 
Ashish oot
Ashish ootAshish oot
Ashish oot
Ashish Agrawal
 
oops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdfoops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdf
ArpitaJana28
 
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
AnkurSingh340457
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
dheva B
 
Java pdf
Java   pdfJava   pdf
Java pdf
Vinod Panchatcharam
 
OOP Lesson 2.pptx
OOP Lesson 2.pptxOOP Lesson 2.pptx
OOP Lesson 2.pptx
FranzLawrenzDeTorres1
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
object oriented programming and methodology.pptx
object oriented programming and methodology.pptxobject oriented programming and methodology.pptx
object oriented programming and methodology.pptx
ayush626953
 
Overview of Object Oriented Programming using C++
Overview of Object Oriented Programming using C++Overview of Object Oriented Programming using C++
Overview of Object Oriented Programming using C++
jayanthi699330
 
INTRODUCTION AND BASIC CONCEPT OF OOAD.pptx
INTRODUCTION AND BASIC CONCEPT OF OOAD.pptxINTRODUCTION AND BASIC CONCEPT OF OOAD.pptx
INTRODUCTION AND BASIC CONCEPT OF OOAD.pptx
hewor74970
 
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtapOverview of Object-Oriented Concepts Characteristics by vikas jagtap
Overview of Object-Oriented Concepts Characteristics by vikas jagtap
Vikas Jagtap
 
Objects oriented programming concepts.docx
Objects oriented programming concepts.docxObjects oriented programming concepts.docx
Objects oriented programming concepts.docx
JSEThomasR
 
oops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdfoops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdf
ArpitaJana28
 
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Mod...
AnkurSingh340457
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
dheva B
 

More from sanaiftikhar23 (9)

Multiple Regression in machine learning.pptx
Multiple Regression in machine learning.pptxMultiple Regression in machine learning.pptx
Multiple Regression in machine learning.pptx
sanaiftikhar23
 
Object Oriented Programming fundamentals.pptx
Object Oriented Programming fundamentals.pptxObject Oriented Programming fundamentals.pptx
Object Oriented Programming fundamentals.pptx
sanaiftikhar23
 
MobApp 07 componentof screen layout.pptx
MobApp 07 componentof screen layout.pptxMobApp 07 componentof screen layout.pptx
MobApp 07 componentof screen layout.pptx
sanaiftikhar23
 
Displaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxDisplaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptx
sanaiftikhar23
 
MobApp development 01 application platform.pptx
MobApp development 01 application platform.pptxMobApp development 01 application platform.pptx
MobApp development 01 application platform.pptx
sanaiftikhar23
 
Visual programming is a type of programming
Visual programming is a type of programmingVisual programming is a type of programming
Visual programming is a type of programming
sanaiftikhar23
 
L21-Introduction-to-IO.ppt
L21-Introduction-to-IO.pptL21-Introduction-to-IO.ppt
L21-Introduction-to-IO.ppt
sanaiftikhar23
 
fundamentals-of-algorithm-2nd-lec-170418023540.pdf
fundamentals-of-algorithm-2nd-lec-170418023540.pdffundamentals-of-algorithm-2nd-lec-170418023540.pdf
fundamentals-of-algorithm-2nd-lec-170418023540.pdf
sanaiftikhar23
 
templates.pptx
templates.pptxtemplates.pptx
templates.pptx
sanaiftikhar23
 
Multiple Regression in machine learning.pptx
Multiple Regression in machine learning.pptxMultiple Regression in machine learning.pptx
Multiple Regression in machine learning.pptx
sanaiftikhar23
 
Object Oriented Programming fundamentals.pptx
Object Oriented Programming fundamentals.pptxObject Oriented Programming fundamentals.pptx
Object Oriented Programming fundamentals.pptx
sanaiftikhar23
 
MobApp 07 componentof screen layout.pptx
MobApp 07 componentof screen layout.pptxMobApp 07 componentof screen layout.pptx
MobApp 07 componentof screen layout.pptx
sanaiftikhar23
 
Displaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptxDisplaying google maps in mobileapplication.pptx
Displaying google maps in mobileapplication.pptx
sanaiftikhar23
 
MobApp development 01 application platform.pptx
MobApp development 01 application platform.pptxMobApp development 01 application platform.pptx
MobApp development 01 application platform.pptx
sanaiftikhar23
 
Visual programming is a type of programming
Visual programming is a type of programmingVisual programming is a type of programming
Visual programming is a type of programming
sanaiftikhar23
 
L21-Introduction-to-IO.ppt
L21-Introduction-to-IO.pptL21-Introduction-to-IO.ppt
L21-Introduction-to-IO.ppt
sanaiftikhar23
 
fundamentals-of-algorithm-2nd-lec-170418023540.pdf
fundamentals-of-algorithm-2nd-lec-170418023540.pdffundamentals-of-algorithm-2nd-lec-170418023540.pdf
fundamentals-of-algorithm-2nd-lec-170418023540.pdf
sanaiftikhar23
 
Ad

Recently uploaded (20)

Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptxWhat is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
Respiratory System , Urinary System
Respiratory  System , Urinary SystemRespiratory  System , Urinary System
Respiratory System , Urinary System
RushiMandali
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdfAllomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.
jmansha170
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
National Information Standards Organization (NISO)
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptxCapitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
What are the benefits that dance brings?
What are the benefits that dance brings?What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition OecdEnergy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti MpdBasic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptxWhat is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
Respiratory System , Urinary System
Respiratory  System , Urinary SystemRespiratory  System , Urinary System
Respiratory System , Urinary System
RushiMandali
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdfAllomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
Rose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdfRose Cultivation Practices by Kushal Lamichhane.pdf
Rose Cultivation Practices by Kushal Lamichhane.pdf
kushallamichhame
 
Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.Artificial intelligence Presented by JM.
Artificial intelligence Presented by JM.
jmansha170
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptxCapitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
What are the benefits that dance brings?
What are the benefits that dance brings?What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition OecdEnergy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
Ad

Object Oriented Programming Language is an oop

  • 2. Introduction to oop • Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, messaging, modularity, polymorphism, and inheritance. Many modern programming languages now support OOP.
  • 3. Programming paradigm : A programming paradigm is a fundamental style of computer programming. Paradigms differ in the concepts and abstractions used to represent the elements of a program (such as objects, functions, variables, constraints, etc.) and the steps that compose a computation (assignment, evaluation, continuations, data flows, etc.).
  • 4. Classes: In object-oriented programming, a class is a construct that is used as a blueprint to create instances of the class (class instances, class objects, instance objects or just objects). A class defines constituent members which enable class instances to have state and behavior. Data field members (member variables or instance variables) enable a class object to maintain state. Other kinds of members, especially methods, enable a class object's behavior. Class instances are of the type of the associated class. For example, an instance of the class "Fruit" (a "Fruit" object) would be of the type "Fruit". A class usually represents a noun, such as a person, place or (possibly quite abstract) thing. Programming languages that include classes as a programming construct subtly differ in their support for various class-related features. Most support various forms of class inheritance. Many languages also support advanced encapsulation control features, such as access specifiers.
  • 5. Object: Object is an run time entity. Is an Instance of class Represents a Place ,Person ,anything that have some attributes.
  • 6. Objects and Instances: There is a very important distinction between an object and an instance of an object. An object is actually a definition, or a template for instances of that object. An instance of an object is an actual thing that can be manipulated. For instance, we could define a Person object, which may include such member data as hair color, eye color, height, weight, etc. An instance of this object could be "Dave" and Dave has values for hair color, eye color, etc. This allows for multiple instances of an object to be created.
  • 7. Data Encapsulation and Abstraction: Data encapsulation, sometimes referred to as data hiding. Data Encapsulation and Data Abstraction is one of the most striking feature of object oriented programming. The wrapping up of data and code into a single unit is called data encapsulation. The data is not accessible to the outside world only those functions which are wrapped into a class can only access the private data of the class. Contd…
  • 8. The concept of data encapsulation is supported in C++ through the use of the public, protected and private keywords which are placed in the declaration of the class. Note : Anything in the class placed after the public keyword is accessible to all the users of the class Elements placed after the protected keyword are accessible only to the methods of the class or classes derived from that class Elements placed after the private keyword are accessible only to the methods of the class.
  • 9. Inheritance : Inheritance is one of the most striking feature of object oriented programming. Inheritance is the process by which one class can acquire the properties of another class. The new classes, known as subclasses (or derived classes), inherit attributes and behavior of the pre-existing classes, which are referred to as superclasses (or ancestor classes). The inheritance relationships of classes gives rise to a hierarchy Contd…
  • 10. A superclass, base class, or parent class is a class from which other classes are derived. The classes that are derived from a superclass are known as child classes, derived classes, or subclasses. In object-oriented programming (OOP), inheritance is a way to compartmentalize and reuse code by creating collections of attributes and behaviors called objects which can be based on previously created objects.