SlideShare a Scribd company logo
OBJECT ORIENTED
PROGRAMMING CONCEPTS
UNIT 1
PREPARED BY
LOKESH SHARMA AND HARSH
SHARMA
PROCEDURAL LANGUAGE AND OBJECT
ORIENTED APPROACH
Procedural Oriented Programming Object-Oriented Programming
In procedural programming, the program is
divided into small parts called functions.
In object-oriented programming, the
program is divided into small parts
called objects.
There is no access specifier in procedural
programming.
Object-oriented programming has access
specifiers like private, public, protected,
etc.
Adding new data and functions is not easy. Adding new data and function is easy.
Procedural programming does not have any
proper way of hiding data so it is less secure.
Object-oriented programming provides
data hiding so it is more secure.
In procedural programming, overloading is
not possible.
Overloading is possible in object-oriented
programming.
In procedural programming, the function is
more important than the data.
In object-oriented programming, data is
more important than function.
Code reusability absent in procedural
programming,
Code reusability present in object-oriented
programming.
Examples: C, FORTRAN, Pascal, Basic, etc. Examples: C++, Java, Python, C#, etc.
CHARACTERSTICS OF OOPS
Object-oriented programming (OOP) has become one of the most popular
programming paradigms at the current time. Almost every major programming
language provides some form of OOP support, making it a very accessible option
for programmers of various levels and domains.
OBJECTS
In C++, Object is a real world entity, for example, chair, car, pen,
mobile, laptop etc.
In other words, object is an entity that has state and behavior. Here,
state means data and behavior means functionality.
Object is a runtime entity, it is created at runtime.
Student s1; //creating an object of Student
Let's see an example to create object of student class using s1 as the reference
variable.
In this example, Student is the type and s1 is the reference variable
that refers to the instance of Student class.
CLASSES
The next characteristic of object-oriented programming is the definition of classes.
A class is where the blueprint for an object is defined. The blueprint defines the
methods, attributes, and other aspects of the object. Objects are created from
classes. A class is also known as a blueprint for an object. It defines properties,
methods, and other aspects associated with the object. Objects are created from
classes. A class is essentially a blueprint for an object. It defines properties,
methods, and other aspects associated with the object.
ENCAPSULATION
Another characteristic of OOP is that it emphasizes the encapsulation of data and
functionality within objects. Objects are defined with specific functionality that
governs the interactions between the objects. Encapsulation of data is an
extremely important aspect of OOP. This is because it prevents hackers from
modifying data that is stored in the database
Abstraction
If you are a user, and you have a problem statement, you don't want to
know how the components of the software work, or how it's made. You only
want to know how the software solves your problem. Abstraction is the
method of hiding unnecessary details from the necessary ones. It is one of
the main features of OOPs. For example, consider a car. You only need to
know how to run a car, and not how the wires are connected inside it. This
is obtained using Abstraction
INHERITANCE
Inheritance means inheriting someone's characteristics. Just like you inherit
features and habits from your parents, it is possible to inherit the data and
methods from one class to another. Combining and inheriting the objects and
their properties is one of the most essential and important characteristics of
oops.
Super Class: The class from which the properties are inherited by the sub
class/child class.
Sub Class: The class which inherits the properties from the super
class/parent class.
Inheritance helps you do the separation of the same fields and functionality
so that it can be reused in other classes. And this helps in code redundancy.
Composition
Composition is the procedure of combining two or more objects together
to create a new and unique object. Through this process developers find it
easy to reuse the elements specifically needed for the object to create a
new and unique object
POLYMORPHISM
Polymorphism means to have the same name of a method performing different
tasks. For example, in finding out the area of the shape, the area of the square is
length2, and the area of the rectangle is length*breadth.
It has the ability to display the message in more than one form. A person can
possess different characteristics at the same time, so this is what polymorphism is
all about.
Polymorphism exhibits two different
behaviors
Static Polymorphism/ Method Overloading: It occurs when methods with the
same name have differences in the number and types of parameters.
For example:
Explanation:
Both Person and Child classes have the
same method, i.e., walks(), and the Child
class overrides the walks() method by
having its own implementation.
OUTPUT :-
Static Polymorphism/ Method Overloading: It
occurs when methods with the same name have differences in the number and
types of parameters.
Explanation:
In the above code, the show() method is
overloaded by changing the number of
parameters as well as by changing the name
of the data type. So this is known as Method
Overloading.
Polymorphism has the ability to perform
different tasks with the same method, due
to which the code is clean.
OUTPUT:-
Data Binding
Binding means to bind one thing to another one. Here in OOPS, binding refers to
linking some attribute of one object to another one in the Application.
There are two main types of binding:
Static Binding
Dynamic binding
Let's understand both of them using an example.
Static Binding
In static binding, the property of one object is changed directly without changing
the other property.
OUTPUT:-
Explanation
When any type of object
is determined at the
compile time, then it is
known as static binding.
Also, play() and walks()
are private methods, and
that is the reason for
the static binding.
Dynamic Binding
When any object is determined at the run time, then it is known as dynamic
binding.
Dynamic Binding occurs when the property of one object changes, and due to
this, the property of another object gets changed.
OUTPUT:-
Explanation
In the above code, the instance of Child
is also an instance of Person, So the
compiler can't determine the object
type.
MESSAGE PASSING
Passing data around the program is the most important feature of the oop concept.
Message passing is the sending of a message from one object to another. How does
this occur?
As we know that each object has its own specific address that other objects can use
to send messages. Now that object can do whatever it needs to do based on the
message. Multiple objects can communicate with each other in interesting ways.
Ad

Recommended

Procedural-vs-Object-Oriented-Programming (1).pdf
Procedural-vs-Object-Oriented-Programming (1).pdf
AnujMalviya12
 
object oriented programming concepts and explanation
object oriented programming concepts and explanation
SATYA136395
 
Object oriented programming (oops) python
Object oriented programming (oops) python
TayyabaIrshad6
 
Chapter 04 object oriented programming
Chapter 04 object oriented programming
Praveen M Jigajinni
 
SKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPT
Skillwise Group
 
object oriented programming and methodology.pptx
object oriented programming and methodology.pptx
ayush626953
 
Chapter1
Chapter1
jammiashok123
 
Block_1_Unit- I.pdf bca learning for exam you
Block_1_Unit- I.pdf bca learning for exam you
vosawe9128
 
Need of object oriented programming
Need of object oriented programming
Amar Jukuntla
 
Object Oriented Programming Concepts
Object Oriented Programming Concepts
SanmatiRM
 
POP vs OOP Introduction
POP vs OOP Introduction
Hashni T
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
introduction of Object oriented programming
introduction of Object oriented programming
RiturajJain8
 
Oops concepts
Oops concepts
Kanan Gandhi
 
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
akashsachu221
 
CPP-Unit 1.pptx
CPP-Unit 1.pptx
YashKoli22
 
Object oriented programming 6 oop with c++
Object oriented programming 6 oop with c++
Vaibhav Khanna
 
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
Questpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPS
gdrealspace
 
Object oriented programming
Object oriented programming
baabtra.com - No. 1 supplier of quality freshers
 
Characteristics-and-Advantages-of-Object-Oriented-Programming.pptx
Characteristics-and-Advantages-of-Object-Oriented-Programming.pptx
mahendrasubedi2060
 
Basic concept of OOP's
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
Basics of object oriented programming c++ [autosaved]
Basics of object oriented programming c++ [autosaved]
RAVIPUROHIT22
 
Object Oriented Programming Concepts Using C++
Object Oriented Programming Concepts Using C++
Mtnc BCA DEPARTMENT
 
yo.pptxoajsdisa odasjd asodjaojdoawjdoasjdow
yo.pptxoajsdisa odasjd asodjaojdoawjdoasjdow
l226207
 
IET307 OOP - object oriented programming concepts.pptx
IET307 OOP - object oriented programming concepts.pptx
BasithAb2
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
“THE BEST CLASS IN SCHOOL”. _
“THE BEST CLASS IN SCHOOL”. _
Colégio Santa Teresinha
 

More Related Content

Similar to OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx (20)

Need of object oriented programming
Need of object oriented programming
Amar Jukuntla
 
Object Oriented Programming Concepts
Object Oriented Programming Concepts
SanmatiRM
 
POP vs OOP Introduction
POP vs OOP Introduction
Hashni T
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
introduction of Object oriented programming
introduction of Object oriented programming
RiturajJain8
 
Oops concepts
Oops concepts
Kanan Gandhi
 
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
akashsachu221
 
CPP-Unit 1.pptx
CPP-Unit 1.pptx
YashKoli22
 
Object oriented programming 6 oop with c++
Object oriented programming 6 oop with c++
Vaibhav Khanna
 
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
Questpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPS
gdrealspace
 
Object oriented programming
Object oriented programming
baabtra.com - No. 1 supplier of quality freshers
 
Characteristics-and-Advantages-of-Object-Oriented-Programming.pptx
Characteristics-and-Advantages-of-Object-Oriented-Programming.pptx
mahendrasubedi2060
 
Basic concept of OOP's
Basic concept of OOP's
Prof. Dr. K. Adisesha
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
Basics of object oriented programming c++ [autosaved]
Basics of object oriented programming c++ [autosaved]
RAVIPUROHIT22
 
Object Oriented Programming Concepts Using C++
Object Oriented Programming Concepts Using C++
Mtnc BCA DEPARTMENT
 
yo.pptxoajsdisa odasjd asodjaojdoawjdoasjdow
yo.pptxoajsdisa odasjd asodjaojdoawjdoasjdow
l226207
 
IET307 OOP - object oriented programming concepts.pptx
IET307 OOP - object oriented programming concepts.pptx
BasithAb2
 
Need of object oriented programming
Need of object oriented programming
Amar Jukuntla
 
Object Oriented Programming Concepts
Object Oriented Programming Concepts
SanmatiRM
 
POP vs OOP Introduction
POP vs OOP Introduction
Hashni T
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
introduction of Object oriented programming
introduction of Object oriented programming
RiturajJain8
 
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
akashsachu221
 
CPP-Unit 1.pptx
CPP-Unit 1.pptx
YashKoli22
 
Object oriented programming 6 oop with c++
Object oriented programming 6 oop with c++
Vaibhav Khanna
 
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
chapterOne.pptxFSdgfqdzwwfagxgghvkjljhcxCZZXvcbx
berihun18
 
Questpond - Top 10 Interview Questions and Answers on OOPS
Questpond - Top 10 Interview Questions and Answers on OOPS
gdrealspace
 
Characteristics-and-Advantages-of-Object-Oriented-Programming.pptx
Characteristics-and-Advantages-of-Object-Oriented-Programming.pptx
mahendrasubedi2060
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
Madishetty Prathibha
 
Basics of object oriented programming c++ [autosaved]
Basics of object oriented programming c++ [autosaved]
RAVIPUROHIT22
 
Object Oriented Programming Concepts Using C++
Object Oriented Programming Concepts Using C++
Mtnc BCA DEPARTMENT
 
yo.pptxoajsdisa odasjd asodjaojdoawjdoasjdow
yo.pptxoajsdisa odasjd asodjaojdoawjdoasjdow
l226207
 
IET307 OOP - object oriented programming concepts.pptx
IET307 OOP - object oriented programming concepts.pptx
BasithAb2
 

Recently uploaded (20)

Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
“THE BEST CLASS IN SCHOOL”. _
“THE BEST CLASS IN SCHOOL”. _
Colégio Santa Teresinha
 
Publishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke Warner
Brooke Warner
 
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
 
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
Celine George
 
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
RAKESH SAJJAN
 
Chalukyas of Gujrat, Solanki Dynasty NEP.pptx
Chalukyas of Gujrat, Solanki Dynasty NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
RAKESH SAJJAN
 
ICT-8-Module-REVISED-K-10-CURRICULUM.pdf
ICT-8-Module-REVISED-K-10-CURRICULUM.pdf
penafloridaarlyn
 
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
Publishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke Warner
Brooke Warner
 
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
 
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
Celine George
 
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Basic English for Communication - Dr Hj Euis Eti Rohaeti Mpd
Restu Bias Primandhika
 
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
RAKESH SAJJAN
 
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
RAKESH SAJJAN
 
ICT-8-Module-REVISED-K-10-CURRICULUM.pdf
ICT-8-Module-REVISED-K-10-CURRICULUM.pdf
penafloridaarlyn
 
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
Ad

OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx

  • 1. OBJECT ORIENTED PROGRAMMING CONCEPTS UNIT 1 PREPARED BY LOKESH SHARMA AND HARSH SHARMA
  • 2. PROCEDURAL LANGUAGE AND OBJECT ORIENTED APPROACH Procedural Oriented Programming Object-Oriented Programming In procedural programming, the program is divided into small parts called functions. In object-oriented programming, the program is divided into small parts called objects. There is no access specifier in procedural programming. Object-oriented programming has access specifiers like private, public, protected, etc. Adding new data and functions is not easy. Adding new data and function is easy. Procedural programming does not have any proper way of hiding data so it is less secure. Object-oriented programming provides data hiding so it is more secure. In procedural programming, overloading is not possible. Overloading is possible in object-oriented programming. In procedural programming, the function is more important than the data. In object-oriented programming, data is more important than function. Code reusability absent in procedural programming, Code reusability present in object-oriented programming. Examples: C, FORTRAN, Pascal, Basic, etc. Examples: C++, Java, Python, C#, etc.
  • 3. CHARACTERSTICS OF OOPS Object-oriented programming (OOP) has become one of the most popular programming paradigms at the current time. Almost every major programming language provides some form of OOP support, making it a very accessible option for programmers of various levels and domains.
  • 4. OBJECTS In C++, Object is a real world entity, for example, chair, car, pen, mobile, laptop etc. In other words, object is an entity that has state and behavior. Here, state means data and behavior means functionality. Object is a runtime entity, it is created at runtime. Student s1; //creating an object of Student Let's see an example to create object of student class using s1 as the reference variable. In this example, Student is the type and s1 is the reference variable that refers to the instance of Student class.
  • 5. CLASSES The next characteristic of object-oriented programming is the definition of classes. A class is where the blueprint for an object is defined. The blueprint defines the methods, attributes, and other aspects of the object. Objects are created from classes. A class is also known as a blueprint for an object. It defines properties, methods, and other aspects associated with the object. Objects are created from classes. A class is essentially a blueprint for an object. It defines properties, methods, and other aspects associated with the object.
  • 6. ENCAPSULATION Another characteristic of OOP is that it emphasizes the encapsulation of data and functionality within objects. Objects are defined with specific functionality that governs the interactions between the objects. Encapsulation of data is an extremely important aspect of OOP. This is because it prevents hackers from modifying data that is stored in the database
  • 7. Abstraction If you are a user, and you have a problem statement, you don't want to know how the components of the software work, or how it's made. You only want to know how the software solves your problem. Abstraction is the method of hiding unnecessary details from the necessary ones. It is one of the main features of OOPs. For example, consider a car. You only need to know how to run a car, and not how the wires are connected inside it. This is obtained using Abstraction
  • 8. INHERITANCE Inheritance means inheriting someone's characteristics. Just like you inherit features and habits from your parents, it is possible to inherit the data and methods from one class to another. Combining and inheriting the objects and their properties is one of the most essential and important characteristics of oops. Super Class: The class from which the properties are inherited by the sub class/child class. Sub Class: The class which inherits the properties from the super class/parent class. Inheritance helps you do the separation of the same fields and functionality so that it can be reused in other classes. And this helps in code redundancy. Composition Composition is the procedure of combining two or more objects together to create a new and unique object. Through this process developers find it easy to reuse the elements specifically needed for the object to create a new and unique object
  • 9. POLYMORPHISM Polymorphism means to have the same name of a method performing different tasks. For example, in finding out the area of the shape, the area of the square is length2, and the area of the rectangle is length*breadth. It has the ability to display the message in more than one form. A person can possess different characteristics at the same time, so this is what polymorphism is all about.
  • 10. Polymorphism exhibits two different behaviors Static Polymorphism/ Method Overloading: It occurs when methods with the same name have differences in the number and types of parameters. For example: Explanation: Both Person and Child classes have the same method, i.e., walks(), and the Child class overrides the walks() method by having its own implementation. OUTPUT :-
  • 11. Static Polymorphism/ Method Overloading: It occurs when methods with the same name have differences in the number and types of parameters. Explanation: In the above code, the show() method is overloaded by changing the number of parameters as well as by changing the name of the data type. So this is known as Method Overloading. Polymorphism has the ability to perform different tasks with the same method, due to which the code is clean. OUTPUT:-
  • 12. Data Binding Binding means to bind one thing to another one. Here in OOPS, binding refers to linking some attribute of one object to another one in the Application. There are two main types of binding: Static Binding Dynamic binding Let's understand both of them using an example. Static Binding In static binding, the property of one object is changed directly without changing the other property.
  • 13. OUTPUT:- Explanation When any type of object is determined at the compile time, then it is known as static binding. Also, play() and walks() are private methods, and that is the reason for the static binding.
  • 14. Dynamic Binding When any object is determined at the run time, then it is known as dynamic binding. Dynamic Binding occurs when the property of one object changes, and due to this, the property of another object gets changed. OUTPUT:- Explanation In the above code, the instance of Child is also an instance of Person, So the compiler can't determine the object type.
  • 15. MESSAGE PASSING Passing data around the program is the most important feature of the oop concept. Message passing is the sending of a message from one object to another. How does this occur? As we know that each object has its own specific address that other objects can use to send messages. Now that object can do whatever it needs to do based on the message. Multiple objects can communicate with each other in interesting ways.