SlideShare a Scribd company logo
Unit 1 : Introduction and Basics of OOP’s
Object means a real word entity such as pen, chair,
table etc.
Object-Oriented Programming is a methodology or
paradigm to design a program using classes and
objects.
Introduction to Object Oriented Paradigm :-
• The main necessity behind inventing object oriented approach is to remove
the drawback encountered in the procedural approach.
• The programming paradigm object treats data as an element in the program
development.
• It ties the data to the function that operates on it and hides and protects it
from accidental updates by external functions.
• Object oriented programming paradigm allows decomposition of the system
into the number of entities called objects and then ties properties and
function to these objects.
• An object’s properties can be accessed only by the functions associated with
that object but functions of one object can access the function of other
objects in the same cases using access specifiers.
Need Object Oriented Programming :-
• The main aim of OOP is to bind together the data and the
functions that operate on them so that no other part of the
code can access this data except that function.
• With the use of classes and objects, object-oriented
programming makes code maintenance simple. Because
inheritance allows for code reuse, the program is simpler
because you don't have to write the same code repeatedly.
Data hiding is also provided by ideas like encapsulation and
abstraction.
• The software produced using object-oriented programming
paradigm is easier to adapt to the changing requirements,
easier to maintain, create modules of functionality, promote
greater design, be more robust, and perform desired work
efficiently.
Characteristics of OOP’s :-
• Object
• Class
• Inheritance
• Polymorphism
• Abstraction
• Encapsulation
• Object :
Any entity that has state and behavior is known as an
object. For example: chair, pen, table, keyboard, bike etc. It
can be physical and logical.
• Class :
Collection of objects is called class. It is a logical entity.
A Class in C++ is the foundational element that leads to
Object-Oriented programming.
A class instance must be created in order to access and
use the user-defined data type's, data members and
member functions. An object's class acts as its blueprint.
Ex. Car Class. Even if different names and brands may be
used for different cars, all of them will have some
characteristics in common, such as four wheels, a speed
limit, a range of miles, etc. In this case, the class of car is
represented by the wheels, the speed limitations, and the
mileage.
• Inheritance :
When one object acquires all the properties and
behaviours of parent object i.e. known as inheritance.
It provides code reusability. It is used to achieve
runtime polymorphism.
Sub class - Subclass or Derived Class refers to a class that
receives properties from another class.
Super class - The term "Base Class" or "Super Class" refers
to the class from which a subclass inherits its properties.
Reusability - As a result, when we wish to create a new
class, but an existing class already contains some of the
code we need, we can generate our new class from the
old class. This allows us to utilize the fields and methods
of the pre-existing class.
• Polymorphism :
Polymorphism means "many forms", and it occurs when
we have many classes that are related to each other by
inheritance.
Let's consider a real-life example of polymorphism. A lady
behaves like a teacher in a classroom, mother or daughter in a
home and customer in a market. Here, a single person is
behaving differently according to the situations.
Polymorphism is considered one of the important
features of Object-Oriented Programming.
• Abstraction :
Data Abstraction is a process of providing only the
essential details to the outside world and hiding the internal
details, i.e., representing only the essential details in the
program.
Let's take a real life example of AC, which can be
turned ON or OFF, change the temperature, change the
mode, and other external components such as fan, swing.
But, we don't know the internal details of the AC, i.e., how it
works internally. Thus, we can say that AC seperates the
implementation details from the external interface.
C++ provides a great level of abstraction. For example,
pow() function is used to calculate the power of a number
without knowing the algorithm the function follows.
• Encapsulation :
Binding (or wrapping) code and data together into a single unit is known as
encapsulation.
For example: capsule, it is wrapped with different medicines.
Encapsulation is typically understood as the grouping of related pieces of
information and data into a single entity.
• Difference of Structured Vs. OOPs
Sr no. Structured Programming Object-Oriented Programming
1 Programs are divided into small programs or
functions.
Programs are divided into objects or
entities.
2 It is all about facilitating creation of programs with
readable code and reusable components.
It is all about creating objects that usually
contain both functions and data.
3
Its main aim is to improve and increase quality,
clarity, and development time of computer program.
Its main aim is to improve and increase both
quality and productivity of system analysis
and design.
4 It is a method of organizing, managing and coding
programs that can give or provide much easier
modification and understanding.
It is a method in which set of objects can
vary dynamically and can execute just by
acting and reading to each other.
5 It generally follows “Top-Down Approach”. It generally follows “Bottom-Up Approach”.
6 It is more difficult to modify structured program and
reuse code as compared to object-oriented
programs.
It is less difficult to modify object-oriented
programs and reuse code as compared to
structured programs.
7
It gives more importance of code. It gives more importance to data.

More Related Content

Similar to CPP-Unit 1.pptx

PHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptxPHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptx
Atikur Rahman
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
MD Sulaiman
 
80410172053.pdf
80410172053.pdf80410172053.pdf
80410172053.pdf
WrushabhShirsat3
 
Chapter 1
Chapter 1Chapter 1
Object Oriented Program Class 12 Computer Science
Object Oriented Program Class 12 Computer ScienceObject Oriented Program Class 12 Computer Science
Object Oriented Program Class 12 Computer Science
ShailendraPandey96
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
SherinRappai
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
SherinRappai1
 
Intro to oop.pptx
Intro to oop.pptxIntro to oop.pptx
Intro to oop.pptx
UmerUmer25
 
Benefits of encapsulation
Benefits of encapsulationBenefits of encapsulation
Benefits of encapsulation
Muhammad Nawzir Khan
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)Jay Patel
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
Geophery sanga
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
ACCESS Health Digital
 
Bt8901 objective oriented systems1
Bt8901 objective oriented systems1Bt8901 objective oriented systems1
Bt8901 objective oriented systems1
Techglyphs
 
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
CS3391 -OOP -UNIT – I  NOTES FINAL.pdfCS3391 -OOP -UNIT – I  NOTES FINAL.pdf
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
 
DOC-20210303-WA0017..pptx,coding stuff in c
DOC-20210303-WA0017..pptx,coding stuff in cDOC-20210303-WA0017..pptx,coding stuff in c
DOC-20210303-WA0017..pptx,coding stuff in c
floraaluoch3
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
FellowBuddy.com
 
OOP intro.ppt
OOP intro.pptOOP intro.ppt
OOP intro.ppt
NoreenNyauchiSarai1
 
Lesson 1 - Object Oriented Programming CPP103.pptx
Lesson 1 - Object Oriented Programming CPP103.pptxLesson 1 - Object Oriented Programming CPP103.pptx
Lesson 1 - Object Oriented Programming CPP103.pptx
LuiFlor
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
Unit v(dsc++)
Unit v(dsc++)Unit v(dsc++)
Unit v(dsc++)
Durga Devi
 

Similar to CPP-Unit 1.pptx (20)

PHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptxPHP OOP Lecture - 01.pptx
PHP OOP Lecture - 01.pptx
 
Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)Fundamentals of OOP (Object Oriented Programming)
Fundamentals of OOP (Object Oriented Programming)
 
80410172053.pdf
80410172053.pdf80410172053.pdf
80410172053.pdf
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Object Oriented Program Class 12 Computer Science
Object Oriented Program Class 12 Computer ScienceObject Oriented Program Class 12 Computer Science
Object Oriented Program Class 12 Computer Science
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
 
Unit 2.pptx
Unit 2.pptxUnit 2.pptx
Unit 2.pptx
 
Intro to oop.pptx
Intro to oop.pptxIntro to oop.pptx
Intro to oop.pptx
 
Benefits of encapsulation
Benefits of encapsulationBenefits of encapsulation
Benefits of encapsulation
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
 
object oriented programing lecture 1
object oriented programing lecture 1object oriented programing lecture 1
object oriented programing lecture 1
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
 
Bt8901 objective oriented systems1
Bt8901 objective oriented systems1Bt8901 objective oriented systems1
Bt8901 objective oriented systems1
 
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
CS3391 -OOP -UNIT – I  NOTES FINAL.pdfCS3391 -OOP -UNIT – I  NOTES FINAL.pdf
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
 
DOC-20210303-WA0017..pptx,coding stuff in c
DOC-20210303-WA0017..pptx,coding stuff in cDOC-20210303-WA0017..pptx,coding stuff in c
DOC-20210303-WA0017..pptx,coding stuff in c
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
 
OOP intro.ppt
OOP intro.pptOOP intro.ppt
OOP intro.ppt
 
Lesson 1 - Object Oriented Programming CPP103.pptx
Lesson 1 - Object Oriented Programming CPP103.pptxLesson 1 - Object Oriented Programming CPP103.pptx
Lesson 1 - Object Oriented Programming CPP103.pptx
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
Unit v(dsc++)
Unit v(dsc++)Unit v(dsc++)
Unit v(dsc++)
 

More from YashKoli22

Distrubutated control system elecal.pptx
Distrubutated control system elecal.pptxDistrubutated control system elecal.pptx
Distrubutated control system elecal.pptx
YashKoli22
 
YASH HTML CODES
YASH HTML CODESYASH HTML CODES
YASH HTML CODES
YashKoli22
 
YASH HTML CODE
YASH HTML CODE YASH HTML CODE
YASH HTML CODE
YashKoli22
 
WEB DESIGN PRACTICLE bca
WEB DESIGN PRACTICLE bcaWEB DESIGN PRACTICLE bca
WEB DESIGN PRACTICLE bca
YashKoli22
 
topology.pptx
topology.pptxtopology.pptx
topology.pptx
YashKoli22
 
pptparking-160731172031 (1).pdf
pptparking-160731172031 (1).pdfpptparking-160731172031 (1).pdf
pptparking-160731172031 (1).pdf
YashKoli22
 
yash [Autosaved].pptx
yash [Autosaved].pptxyash [Autosaved].pptx
yash [Autosaved].pptx
YashKoli22
 

More from YashKoli22 (7)

Distrubutated control system elecal.pptx
Distrubutated control system elecal.pptxDistrubutated control system elecal.pptx
Distrubutated control system elecal.pptx
 
YASH HTML CODES
YASH HTML CODESYASH HTML CODES
YASH HTML CODES
 
YASH HTML CODE
YASH HTML CODE YASH HTML CODE
YASH HTML CODE
 
WEB DESIGN PRACTICLE bca
WEB DESIGN PRACTICLE bcaWEB DESIGN PRACTICLE bca
WEB DESIGN PRACTICLE bca
 
topology.pptx
topology.pptxtopology.pptx
topology.pptx
 
pptparking-160731172031 (1).pdf
pptparking-160731172031 (1).pdfpptparking-160731172031 (1).pdf
pptparking-160731172031 (1).pdf
 
yash [Autosaved].pptx
yash [Autosaved].pptxyash [Autosaved].pptx
yash [Autosaved].pptx
 

Recently uploaded

The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 

Recently uploaded (20)

The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 

CPP-Unit 1.pptx

  • 1. Unit 1 : Introduction and Basics of OOP’s Object means a real word entity such as pen, chair, table etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects.
  • 2. Introduction to Object Oriented Paradigm :- • The main necessity behind inventing object oriented approach is to remove the drawback encountered in the procedural approach. • The programming paradigm object treats data as an element in the program development. • It ties the data to the function that operates on it and hides and protects it from accidental updates by external functions. • Object oriented programming paradigm allows decomposition of the system into the number of entities called objects and then ties properties and function to these objects. • An object’s properties can be accessed only by the functions associated with that object but functions of one object can access the function of other objects in the same cases using access specifiers.
  • 3. Need Object Oriented Programming :- • The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function. • With the use of classes and objects, object-oriented programming makes code maintenance simple. Because inheritance allows for code reuse, the program is simpler because you don't have to write the same code repeatedly. Data hiding is also provided by ideas like encapsulation and abstraction. • The software produced using object-oriented programming paradigm is easier to adapt to the changing requirements, easier to maintain, create modules of functionality, promote greater design, be more robust, and perform desired work efficiently.
  • 4. Characteristics of OOP’s :- • Object • Class • Inheritance • Polymorphism • Abstraction • Encapsulation
  • 5. • Object : Any entity that has state and behavior is known as an object. For example: chair, pen, table, keyboard, bike etc. It can be physical and logical. • Class : Collection of objects is called class. It is a logical entity. A Class in C++ is the foundational element that leads to Object-Oriented programming. A class instance must be created in order to access and use the user-defined data type's, data members and member functions. An object's class acts as its blueprint. Ex. Car Class. Even if different names and brands may be used for different cars, all of them will have some characteristics in common, such as four wheels, a speed limit, a range of miles, etc. In this case, the class of car is represented by the wheels, the speed limitations, and the mileage.
  • 6. • Inheritance : When one object acquires all the properties and behaviours of parent object i.e. known as inheritance. It provides code reusability. It is used to achieve runtime polymorphism. Sub class - Subclass or Derived Class refers to a class that receives properties from another class. Super class - The term "Base Class" or "Super Class" refers to the class from which a subclass inherits its properties. Reusability - As a result, when we wish to create a new class, but an existing class already contains some of the code we need, we can generate our new class from the old class. This allows us to utilize the fields and methods of the pre-existing class.
  • 7. • Polymorphism : Polymorphism means "many forms", and it occurs when we have many classes that are related to each other by inheritance. Let's consider a real-life example of polymorphism. A lady behaves like a teacher in a classroom, mother or daughter in a home and customer in a market. Here, a single person is behaving differently according to the situations. Polymorphism is considered one of the important features of Object-Oriented Programming.
  • 8. • Abstraction : Data Abstraction is a process of providing only the essential details to the outside world and hiding the internal details, i.e., representing only the essential details in the program. Let's take a real life example of AC, which can be turned ON or OFF, change the temperature, change the mode, and other external components such as fan, swing. But, we don't know the internal details of the AC, i.e., how it works internally. Thus, we can say that AC seperates the implementation details from the external interface. C++ provides a great level of abstraction. For example, pow() function is used to calculate the power of a number without knowing the algorithm the function follows.
  • 9. • Encapsulation : Binding (or wrapping) code and data together into a single unit is known as encapsulation. For example: capsule, it is wrapped with different medicines. Encapsulation is typically understood as the grouping of related pieces of information and data into a single entity.
  • 10. • Difference of Structured Vs. OOPs Sr no. Structured Programming Object-Oriented Programming 1 Programs are divided into small programs or functions. Programs are divided into objects or entities. 2 It is all about facilitating creation of programs with readable code and reusable components. It is all about creating objects that usually contain both functions and data. 3 Its main aim is to improve and increase quality, clarity, and development time of computer program. Its main aim is to improve and increase both quality and productivity of system analysis and design. 4 It is a method of organizing, managing and coding programs that can give or provide much easier modification and understanding. It is a method in which set of objects can vary dynamically and can execute just by acting and reading to each other. 5 It generally follows “Top-Down Approach”. It generally follows “Bottom-Up Approach”. 6 It is more difficult to modify structured program and reuse code as compared to object-oriented programs. It is less difficult to modify object-oriented programs and reuse code as compared to structured programs. 7 It gives more importance of code. It gives more importance to data.