SlideShare a Scribd company logo
BASICS OF
OBJECT
ORIENTED
PROGRAMMING
WHAT IS PROGRAMMING?
Programming is the process of giving instructions to the
computer to perform the desired task.
TYPES OF PROGRAMMING
There are two types of programming paradigms:
PROCEDURAL PROGRAMMING OBJECT ORIENTED
PROGRAMMING
Program is broken down into
functions or subprograms
Program is broken down into objects.
Functions/subprograms work on data.
Data can move freely from function to
function.
Data and its associated functions are
bundled into independent entity.
Data is kept hidden and secured.
It follows top-down approach. It follows bottom-up approach.
Examples: COBOL, Basic Example: Java
NOTE: C++, C sharp, Object Pascal etc. are the languages which support procedural as
well as object oriented paradigm.
Function
1
Local
data
Function 2
Local data
Function
3
Local data
Function 4
Local data
Function 5
Local data
Global data
Main program
OBJECT1
DATA
FUNCTION
S
OBJECT3
DATA
FUNCTION
S
OBJECT
2DATA
FUNCTION
S
TYPES OF PROGRAMMING Contd…
PROCEDURAL PROGRAMMING
OBJECT ORIENTED PROGRAMMING
•The data of an object can be accessed only
by the functions associated with that object.
•However, functions of one object can access
the functions of other objects.
•The data defined inside a function is accessible only by
that function and is called local data of that function.
•The data defined above functions is called Global Data
and is accessible by all functions which are defined below
it.
FEATURES OF OBJECT ORIENTED PROGRAMMING
DATA HIDING, DATA ABSTRACTION, DATA
ENCAPSULATION The process of hiding the data from the outside
world is called DATA HIDING.
 The ability to represent data at very conceptual
level without showing details. It refers to
representing only essential features and hiding the
background details is called DATA ABSTRACTION:
.
 The wrapping up of data and methods that operate
on that data in a single unit is called DATA
ENCAPSULATION. It keeps data both safe from
outside interference and misuse.
 For example, We don't need to know the internal
working of the mobile phone to operate it. We have
an interface to use the device behavior without
Internal machinery of
mobile phone which
is hidden from the
user
External
interface to
operate the
device
FEATURES OF OBJECT ORIENTED PROGRAMMING
Contd…..
DATA HIDING, DATA ABSTRACTION, DATA
ENCAPSULATIONThe mobile phone contains both data and operations that can be
performed on that data. Both data and its associated operations are
bundled together in a single unit i.e. phone. This is called
ENCAPSULATION.
The internal machinery of the phone is hidden from the user , this is
called DATA HIDING.
Only the interface of the phone is available to the user to perform
operations on the phone and rests of the things like machinery etc. are
hidden. This is called DATA ABSTRACTION.
FEATURES OF OBJECT ORIENTED
PROGRAMMING
INHERITANCE
NOTE: All the above features of Object Oriented Programming are implemented with the help
of classes and objects.
 It is feature by which one class acquires the features of an already
existing class.
 Inheritance is a process of creating new class (derived class /sub class /
child class) from existing class (base class / super class / parent class).
 The derived classes not only inherit capabilities of the base class but also
can add new features of their own.
Advantage of Inheritance:
It allows reusability of code. Reusability of code saves money as well as
time and increases program reliability.
To include features of already existing class (debugged) in a new class.
Child class can use the properties and methods of base class.
FEATURES OF OBJECT ORIENTED
PROGRAMMING Contd…
INHERITANCE
NOTE: All the above features of Object Oriented Programming are implemented with the help
of classes and objects.
EXAMPLE:
When the mobiles were first
introduced its basic functionality
was to make and receive calls
and messages.
With every new version of mobile
phone some new features are
added retaining the basic
features.
FEATURES OF OBJECT ORIENTED PROGRAMMING
POLYMORPHISM It means one thing having many forms.
 It is an ability of a method/operator to execute in many forms.
 It is a provision by which an operator or a method exhibits different
characteristics depending upon different sets of input provided to it.
NOTE: All the above features of Object Oriented Programming are implemented with the help
of classes and objects.
POLYMORPHISM
METHOD OVERLOADING
Multiple methods with same method
name which are differentiated on the
basis of different type or number of
arguments.
OPERATOR OVERLOADING
Same operator works
differently in different situation.
FEATURES OF OBJECT ORIENTED PROGRAMMING
Contd….
POLYMORPHISM
EXAMPLES:
 The camera feature of a phone has different modes like slow
motion, photo, video, panorama etc. The functionality of camera is
different depending upon the modes chosen. We can say camera
feature is behaving differently in different modes.
 The SendMessage feature of a mobile phone can be used to send
message to a single person or to multiple people.
NOTE: All the above features of Object Oriented Programming are implemented with the help
of classes and objects.
COMPONENTS OF OBJECT ORIENTED
PROGRAMMING
 CLASS: A class is a group of objects with same attributes and
common behaviors. It is a blue print to create objects.
 OBJECT: An object is an instance of a class that is capable of
holding actual data in memory.
Class and object are related to each other in the same way as data
type and variable. If class is a data type then object is a variable of
that data type.
NOTE: Each object is an entity which has certain properties(data members) and behaviors (methods).
Memory is allocated to the objects and not to the class.
COMPONENTS OF OBJECT ORIENTED
PROGRAMMING Contd…..
 Each object is an entity which has certain attributes/properties(data
members) and behaviors (methods). Memory is allocated to the objects
and not to the class.
 DATA MEMBERS AND METHODS: Data members are used to store
information and methods contain code to perform a particular task.
 ACCESS SPECIFIERS/ VISIBILTY MODES: They are classified as:
 Private
 Protected
 Public
Usually data members are kept in private or protected visibility
modes and methods are kept in the public mode.
NOTE: Members in the private and protected sections of the class are not accessible outside the
class.
COMPONENTS OF OBJECT ORIENTED
PROGRAMMING Contd…..
Examples from real life:
 Animal is a class and dog is an object of this class.
 Phone is a class and iphone is an object.
CLAS
S
OBJE
CT
PROPERTIES
(DATA
MEMBERS)
METHOD
S
Anima
l
dog color Walk()
Bark()
Eat()
Run()
CLASS OBJEC
T
PROPERTIES
(DATA
MEMBERS)
METHODS
Car iphone Make Make_Call()
Year Receive_Call()
color Message()
model Camera()
Price Calculator()
MESSAGE PASSING
In OOP objects send and receive messages in the same way as
human beings. A message for an object is the request for the execution
of a function.
 When a program is executed, the objects interact by sending
messages to one another. Functions of one object can access the
functions of other objects.
For example, if LIBRARY and MEMBERS are two objects in a program,
then the member object can send the request to the library object
requesting for the issue/return of books.
Objects can interact with each other without the details of each other’s
data.
It is sufficient to know the type of message accepted and type of
response returned by the objects.
ABSTRACT CLASS
Abstract class: The classes for which it is not essential to
declare objects to use them are known as abstract classes.
They are normally used as base class in inheritance for
which no direct object is required to be created.
They are used for defining generic methods where there
is no requirement of storing results.
They don’t have data members.
Concrete class: The classes for which objects are required
to be declared are known as concrete classes.
Ad

Recommended

OOP and Its Calculated Measures in Programming Interactivity
OOP and Its Calculated Measures in Programming Interactivity
iosrjce
 
Class 4
Class 4
Miguel Mastarreno Macías
 
Cs690 object oriented_software_engineering_team01_ report
Cs690 object oriented_software_engineering_team01_ report
Khushboo Wadhwani
 
Introduction to Object Oriented Design
Introduction to Object Oriented Design
Computing Cage
 
Jedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented concepts
Maryo Manjaruni
 
Object Oriented Design Concept
Object Oriented Design Concept
Sharath g
 
Object oriented modeling
Object oriented modeling
Pooja Dixit
 
Ooadb
Ooadb
Dr.Jayanthi ramasamy
 
Doppl development iteration #3
Doppl development iteration #3
Diego Perini
 
Object oriented software engineering concepts
Object oriented software engineering concepts
Komal Singh
 
Object Oriented Analysis And Design
Object Oriented Analysis And Design
Sahil Mahajan
 
Oops abap fundamental
Oops abap fundamental
biswajit2015
 
SE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUS
nikshaikh786
 
Ooad Uml
Ooad Uml
Dang Tuan
 
Software enginering.group-no-11 (1)
Software enginering.group-no-11 (1)
riarana10
 
Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5
prakash185645
 
ooAD
ooAD
manjulakithsiri
 
0-oop java-intro
0-oop java-intro
Amr Elghadban (AmrAngry)
 
Object Oriented Design
Object Oriented Design
Sudarsun Santhiappan
 
Ooad unit 1
Ooad unit 1
raj kumar
 
SE-IT DSA LAB SYLLABUS
SE-IT DSA LAB SYLLABUS
nikshaikh786
 
Introduction to OOAD
Introduction to OOAD
Saraswati Saud
 
Darshan--Ip Engineer
Darshan--Ip Engineer
Darshan YS
 
General OOP Concepts
General OOP Concepts
Praveen M Jigajinni
 
C# concepts
C# concepts
lexilijoseph
 
Chapter 04 object oriented programming
Chapter 04 object oriented programming
Praveen M Jigajinni
 
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
Share Unit 1- Basic concept of object-oriented-programming.ppt
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
Unit 1- Basic concept of object-oriented-programming.ppt
Unit 1- Basic concept of object-oriented-programming.ppt
hannahroseline2
 
Unit 1 OOSE
Unit 1 OOSE
ChhayaShelake
 

More Related Content

What's hot (17)

Doppl development iteration #3
Doppl development iteration #3
Diego Perini
 
Object oriented software engineering concepts
Object oriented software engineering concepts
Komal Singh
 
Object Oriented Analysis And Design
Object Oriented Analysis And Design
Sahil Mahajan
 
Oops abap fundamental
Oops abap fundamental
biswajit2015
 
SE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUS
nikshaikh786
 
Ooad Uml
Ooad Uml
Dang Tuan
 
Software enginering.group-no-11 (1)
Software enginering.group-no-11 (1)
riarana10
 
Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5
prakash185645
 
ooAD
ooAD
manjulakithsiri
 
0-oop java-intro
0-oop java-intro
Amr Elghadban (AmrAngry)
 
Object Oriented Design
Object Oriented Design
Sudarsun Santhiappan
 
Ooad unit 1
Ooad unit 1
raj kumar
 
SE-IT DSA LAB SYLLABUS
SE-IT DSA LAB SYLLABUS
nikshaikh786
 
Introduction to OOAD
Introduction to OOAD
Saraswati Saud
 
Darshan--Ip Engineer
Darshan--Ip Engineer
Darshan YS
 
General OOP Concepts
General OOP Concepts
Praveen M Jigajinni
 
C# concepts
C# concepts
lexilijoseph
 
Doppl development iteration #3
Doppl development iteration #3
Diego Perini
 
Object oriented software engineering concepts
Object oriented software engineering concepts
Komal Singh
 
Object Oriented Analysis And Design
Object Oriented Analysis And Design
Sahil Mahajan
 
Oops abap fundamental
Oops abap fundamental
biswajit2015
 
SE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUS
nikshaikh786
 
Software enginering.group-no-11 (1)
Software enginering.group-no-11 (1)
riarana10
 
Oo abap-sap-1206973306636228-5
Oo abap-sap-1206973306636228-5
prakash185645
 
SE-IT DSA LAB SYLLABUS
SE-IT DSA LAB SYLLABUS
nikshaikh786
 
Darshan--Ip Engineer
Darshan--Ip Engineer
Darshan YS
 

Similar to Basics of object oriented programming c++ [autosaved] (20)

Chapter 04 object oriented programming
Chapter 04 object oriented programming
Praveen M Jigajinni
 
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
Share Unit 1- Basic concept of object-oriented-programming.ppt
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
Unit 1- Basic concept of object-oriented-programming.ppt
Unit 1- Basic concept of object-oriented-programming.ppt
hannahroseline2
 
Unit 1 OOSE
Unit 1 OOSE
ChhayaShelake
 
Principles of object oriented programming
Principles of object oriented programming
Amogh Kalyanshetti
 
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
akashsachu221
 
object oriented programming concepts and explanation
object oriented programming concepts and explanation
SATYA136395
 
1 unit (oops)
1 unit (oops)
Jay Patel
 
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) Languages
Jessica Deakin
 
Basic concepts of oops
Basic concepts of oops
Chandrakiran Satdeve
 
Object Oriented Programming Language is an oop
Object Oriented Programming Language is an oop
sanaiftikhar23
 
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
Object Oriented Programming - Cheat sheet.pptx
Object Oriented Programming - Cheat sheet.pptx
MOSIUOA WESI
 
Object Oriented Programming fundamentals.pptx
Object Oriented Programming fundamentals.pptx
sanaiftikhar23
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
hijat789
 
principle of oop’s in cpp
principle of oop’s in cpp
gourav kottawar
 
IET307 OOP - object oriented programming concepts.pptx
IET307 OOP - object oriented programming concepts.pptx
BasithAb2
 
Principles of OOPs.pptx
Principles of OOPs.pptx
LakshyaChauhan21
 
1unit-120324103142-phpapp02.pdf
1unit-120324103142-phpapp02.pdf
SahajShrimal1
 
Chapter 04 object oriented programming
Chapter 04 object oriented programming
Praveen M Jigajinni
 
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
Share Unit 1- Basic concept of object-oriented-programming.ppt
Share Unit 1- Basic concept of object-oriented-programming.ppt
hannahrroselin95
 
Unit 1- Basic concept of object-oriented-programming.ppt
Unit 1- Basic concept of object-oriented-programming.ppt
hannahroseline2
 
Principles of object oriented programming
Principles of object oriented programming
Amogh Kalyanshetti
 
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
akashsachu221
 
object oriented programming concepts and explanation
object oriented programming concepts and explanation
SATYA136395
 
1 unit (oops)
1 unit (oops)
Jay Patel
 
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) Languages
Jessica Deakin
 
Object Oriented Programming Language is an oop
Object Oriented Programming Language is an oop
sanaiftikhar23
 
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
Object Oriented Programming - Cheat sheet.pptx
Object Oriented Programming - Cheat sheet.pptx
MOSIUOA WESI
 
Object Oriented Programming fundamentals.pptx
Object Oriented Programming fundamentals.pptx
sanaiftikhar23
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
hijat789
 
principle of oop’s in cpp
principle of oop’s in cpp
gourav kottawar
 
IET307 OOP - object oriented programming concepts.pptx
IET307 OOP - object oriented programming concepts.pptx
BasithAb2
 
1unit-120324103142-phpapp02.pdf
1unit-120324103142-phpapp02.pdf
SahajShrimal1
 
Ad

Recently uploaded (20)

最新版美国威斯康星大学史蒂文分校毕业证(UWSP毕业证书)原版定制
最新版美国威斯康星大学史蒂文分校毕业证(UWSP毕业证书)原版定制
Taqyea
 
ndss2024xxxxxxxxxxxxxxxxx_slides (1).ppsx
ndss2024xxxxxxxxxxxxxxxxx_slides (1).ppsx
rnkaushal2
 
Using LinkedIn for Your Job Search June 2025
Using LinkedIn for Your Job Search June 2025
Bruce Bennett
 
How to Become a CPA USA and Boost Your Career
How to Become a CPA USA and Boost Your Career
ipfcadwords
 
Plant Evaluation and Historical Developments,PPT.pptx
Plant Evaluation and Historical Developments,PPT.pptx
7300511143
 
Using Social Media in Job Search June 2025
Using Social Media in Job Search June 2025
Bruce Bennett
 
A Guide for a Winning Interview June 2025
A Guide for a Winning Interview June 2025
Bruce Bennett
 
👉 Top 11 IT Companies in Hinjewadi You Should Know About
👉 Top 11 IT Companies in Hinjewadi You Should Know About
vaishalitraffictail
 
SOC_Incident_Report_Process_Presentation.pptx
SOC_Incident_Report_Process_Presentation.pptx
rtanvi1518
 
Academic Preparation for Final Year Externship.pptx
Academic Preparation for Final Year Externship.pptx
Mark Rauterkus
 
CISA Certification And Training online..
CISA Certification And Training online..
Streling next pvt ltd
 
Seniority List of Teachers 2025.pdf......
Seniority List of Teachers 2025.pdf......
shabrosa35196
 
Twilio Jobs Ghaziabad 673 Part Time Job in Uttar Pradesh.pdf
Twilio Jobs Ghaziabad 673 Part Time Job in Uttar Pradesh.pdf
infonaukridekhe
 
PEACH Jobs Board - (Updated on June 12th)
PEACH Jobs Board - (Updated on June 12th)
PEACHOrgnization
 
Emotional_and_Social_Support_Presentation.pptx
Emotional_and_Social_Support_Presentation.pptx
mandiikkj
 
Latest Avaya 71301T Exam Prep | Questions
Latest Avaya 71301T Exam Prep | Questions
sabrina pinto
 
What is UPSC job in India ? , Details about UPSC
What is UPSC job in India ? , Details about UPSC
prathamdigitalmarket
 
ACEN presentation / huddle from June 2025
ACEN presentation / huddle from June 2025
Mark Rauterkus
 
Algebra fjuvrufguisdhvjbfjivjgrbvnbvjhu
Algebra fjuvrufguisdhvjbfjivjgrbvnbvjhu
mikylamongale
 
Gives a structured overview of the skills measured in the DP-700 exam
Gives a structured overview of the skills measured in the DP-700 exam
thehulk1299
 
最新版美国威斯康星大学史蒂文分校毕业证(UWSP毕业证书)原版定制
最新版美国威斯康星大学史蒂文分校毕业证(UWSP毕业证书)原版定制
Taqyea
 
ndss2024xxxxxxxxxxxxxxxxx_slides (1).ppsx
ndss2024xxxxxxxxxxxxxxxxx_slides (1).ppsx
rnkaushal2
 
Using LinkedIn for Your Job Search June 2025
Using LinkedIn for Your Job Search June 2025
Bruce Bennett
 
How to Become a CPA USA and Boost Your Career
How to Become a CPA USA and Boost Your Career
ipfcadwords
 
Plant Evaluation and Historical Developments,PPT.pptx
Plant Evaluation and Historical Developments,PPT.pptx
7300511143
 
Using Social Media in Job Search June 2025
Using Social Media in Job Search June 2025
Bruce Bennett
 
A Guide for a Winning Interview June 2025
A Guide for a Winning Interview June 2025
Bruce Bennett
 
👉 Top 11 IT Companies in Hinjewadi You Should Know About
👉 Top 11 IT Companies in Hinjewadi You Should Know About
vaishalitraffictail
 
SOC_Incident_Report_Process_Presentation.pptx
SOC_Incident_Report_Process_Presentation.pptx
rtanvi1518
 
Academic Preparation for Final Year Externship.pptx
Academic Preparation for Final Year Externship.pptx
Mark Rauterkus
 
CISA Certification And Training online..
CISA Certification And Training online..
Streling next pvt ltd
 
Seniority List of Teachers 2025.pdf......
Seniority List of Teachers 2025.pdf......
shabrosa35196
 
Twilio Jobs Ghaziabad 673 Part Time Job in Uttar Pradesh.pdf
Twilio Jobs Ghaziabad 673 Part Time Job in Uttar Pradesh.pdf
infonaukridekhe
 
PEACH Jobs Board - (Updated on June 12th)
PEACH Jobs Board - (Updated on June 12th)
PEACHOrgnization
 
Emotional_and_Social_Support_Presentation.pptx
Emotional_and_Social_Support_Presentation.pptx
mandiikkj
 
Latest Avaya 71301T Exam Prep | Questions
Latest Avaya 71301T Exam Prep | Questions
sabrina pinto
 
What is UPSC job in India ? , Details about UPSC
What is UPSC job in India ? , Details about UPSC
prathamdigitalmarket
 
ACEN presentation / huddle from June 2025
ACEN presentation / huddle from June 2025
Mark Rauterkus
 
Algebra fjuvrufguisdhvjbfjivjgrbvnbvjhu
Algebra fjuvrufguisdhvjbfjivjgrbvnbvjhu
mikylamongale
 
Gives a structured overview of the skills measured in the DP-700 exam
Gives a structured overview of the skills measured in the DP-700 exam
thehulk1299
 
Ad

Basics of object oriented programming c++ [autosaved]

  • 2. WHAT IS PROGRAMMING? Programming is the process of giving instructions to the computer to perform the desired task.
  • 3. TYPES OF PROGRAMMING There are two types of programming paradigms: PROCEDURAL PROGRAMMING OBJECT ORIENTED PROGRAMMING Program is broken down into functions or subprograms Program is broken down into objects. Functions/subprograms work on data. Data can move freely from function to function. Data and its associated functions are bundled into independent entity. Data is kept hidden and secured. It follows top-down approach. It follows bottom-up approach. Examples: COBOL, Basic Example: Java NOTE: C++, C sharp, Object Pascal etc. are the languages which support procedural as well as object oriented paradigm.
  • 4. Function 1 Local data Function 2 Local data Function 3 Local data Function 4 Local data Function 5 Local data Global data Main program OBJECT1 DATA FUNCTION S OBJECT3 DATA FUNCTION S OBJECT 2DATA FUNCTION S TYPES OF PROGRAMMING Contd… PROCEDURAL PROGRAMMING OBJECT ORIENTED PROGRAMMING •The data of an object can be accessed only by the functions associated with that object. •However, functions of one object can access the functions of other objects. •The data defined inside a function is accessible only by that function and is called local data of that function. •The data defined above functions is called Global Data and is accessible by all functions which are defined below it.
  • 5. FEATURES OF OBJECT ORIENTED PROGRAMMING DATA HIDING, DATA ABSTRACTION, DATA ENCAPSULATION The process of hiding the data from the outside world is called DATA HIDING.  The ability to represent data at very conceptual level without showing details. It refers to representing only essential features and hiding the background details is called DATA ABSTRACTION: .  The wrapping up of data and methods that operate on that data in a single unit is called DATA ENCAPSULATION. It keeps data both safe from outside interference and misuse.  For example, We don't need to know the internal working of the mobile phone to operate it. We have an interface to use the device behavior without Internal machinery of mobile phone which is hidden from the user External interface to operate the device
  • 6. FEATURES OF OBJECT ORIENTED PROGRAMMING Contd….. DATA HIDING, DATA ABSTRACTION, DATA ENCAPSULATIONThe mobile phone contains both data and operations that can be performed on that data. Both data and its associated operations are bundled together in a single unit i.e. phone. This is called ENCAPSULATION. The internal machinery of the phone is hidden from the user , this is called DATA HIDING. Only the interface of the phone is available to the user to perform operations on the phone and rests of the things like machinery etc. are hidden. This is called DATA ABSTRACTION.
  • 7. FEATURES OF OBJECT ORIENTED PROGRAMMING INHERITANCE NOTE: All the above features of Object Oriented Programming are implemented with the help of classes and objects.  It is feature by which one class acquires the features of an already existing class.  Inheritance is a process of creating new class (derived class /sub class / child class) from existing class (base class / super class / parent class).  The derived classes not only inherit capabilities of the base class but also can add new features of their own. Advantage of Inheritance: It allows reusability of code. Reusability of code saves money as well as time and increases program reliability. To include features of already existing class (debugged) in a new class. Child class can use the properties and methods of base class.
  • 8. FEATURES OF OBJECT ORIENTED PROGRAMMING Contd… INHERITANCE NOTE: All the above features of Object Oriented Programming are implemented with the help of classes and objects. EXAMPLE: When the mobiles were first introduced its basic functionality was to make and receive calls and messages. With every new version of mobile phone some new features are added retaining the basic features.
  • 9. FEATURES OF OBJECT ORIENTED PROGRAMMING POLYMORPHISM It means one thing having many forms.  It is an ability of a method/operator to execute in many forms.  It is a provision by which an operator or a method exhibits different characteristics depending upon different sets of input provided to it. NOTE: All the above features of Object Oriented Programming are implemented with the help of classes and objects. POLYMORPHISM METHOD OVERLOADING Multiple methods with same method name which are differentiated on the basis of different type or number of arguments. OPERATOR OVERLOADING Same operator works differently in different situation.
  • 10. FEATURES OF OBJECT ORIENTED PROGRAMMING Contd…. POLYMORPHISM EXAMPLES:  The camera feature of a phone has different modes like slow motion, photo, video, panorama etc. The functionality of camera is different depending upon the modes chosen. We can say camera feature is behaving differently in different modes.  The SendMessage feature of a mobile phone can be used to send message to a single person or to multiple people. NOTE: All the above features of Object Oriented Programming are implemented with the help of classes and objects.
  • 11. COMPONENTS OF OBJECT ORIENTED PROGRAMMING  CLASS: A class is a group of objects with same attributes and common behaviors. It is a blue print to create objects.  OBJECT: An object is an instance of a class that is capable of holding actual data in memory. Class and object are related to each other in the same way as data type and variable. If class is a data type then object is a variable of that data type. NOTE: Each object is an entity which has certain properties(data members) and behaviors (methods). Memory is allocated to the objects and not to the class.
  • 12. COMPONENTS OF OBJECT ORIENTED PROGRAMMING Contd…..  Each object is an entity which has certain attributes/properties(data members) and behaviors (methods). Memory is allocated to the objects and not to the class.  DATA MEMBERS AND METHODS: Data members are used to store information and methods contain code to perform a particular task.  ACCESS SPECIFIERS/ VISIBILTY MODES: They are classified as:  Private  Protected  Public Usually data members are kept in private or protected visibility modes and methods are kept in the public mode. NOTE: Members in the private and protected sections of the class are not accessible outside the class.
  • 13. COMPONENTS OF OBJECT ORIENTED PROGRAMMING Contd….. Examples from real life:  Animal is a class and dog is an object of this class.  Phone is a class and iphone is an object. CLAS S OBJE CT PROPERTIES (DATA MEMBERS) METHOD S Anima l dog color Walk() Bark() Eat() Run() CLASS OBJEC T PROPERTIES (DATA MEMBERS) METHODS Car iphone Make Make_Call() Year Receive_Call() color Message() model Camera() Price Calculator()
  • 14. MESSAGE PASSING In OOP objects send and receive messages in the same way as human beings. A message for an object is the request for the execution of a function.  When a program is executed, the objects interact by sending messages to one another. Functions of one object can access the functions of other objects. For example, if LIBRARY and MEMBERS are two objects in a program, then the member object can send the request to the library object requesting for the issue/return of books. Objects can interact with each other without the details of each other’s data. It is sufficient to know the type of message accepted and type of response returned by the objects.
  • 15. ABSTRACT CLASS Abstract class: The classes for which it is not essential to declare objects to use them are known as abstract classes. They are normally used as base class in inheritance for which no direct object is required to be created. They are used for defining generic methods where there is no requirement of storing results. They don’t have data members. Concrete class: The classes for which objects are required to be declared are known as concrete classes.