SlideShare a Scribd company logo
4
Most read
6
Most read
9
Most read
Present by: Arif Ayoub Ansari
POLYMORPHISM:-
IT IS DERIVED FROM THE GREEK
WORD POLUMORPHOUS
POLUS-MANY
MORPHE-SHAPE/FORM
“HAVING MULTIPLE FORM”
It is the ability for a
message or data to be
processed in more than one
form.
It is the property by which
the same message can be
sent to objects of several
different classes.
Example
The message send by ringing the bell in
school, is processed in many forms by which
we are informed about:-
The beginning of the class,
End of the class,
Beginning of an interval,
End of the day’s classes etc.
Two types of
POLYMORPHISM
STATIC
POLYMORPHISM
DYNAMIC
POLYMORPHISM
STATIC
POLYMORPHISM
Static polymorphism is also called as Compile
Time polymorphism. In Static polymorphism
methods are overloaded with same name but
having different signatures. So it is called as
method overloading.
Static or Compile Time Polymorphism:-
 In static polymorphism, the decision is
made at compile time.
 Which method is to be called is decided
at compile-time only.
 Method overloading is an example of
this.
 Compile time polymorphism is method
overloading, where the compiler knows
which overloaded method it is going to
call.
Example:
-
 public class clsCalculation
 {

 public int Add(int a, int b)
 {
 return a + b;
 }

 public double Add(int z, int x, int c)
 {
 return z + x + c;
 }

 }
DYNAMIC
POLYMORPHISM
Dynamic polymorphism is also called as Run Time
polymorphism. In this type of polymorphism
methods have the same name, same signature but
different in the implementation.
In Dynamic polymorphism methods are overridden
so it also called as method overriding.
Dynamic or Runtime Polymorphism:
 Method overriding allows us to have
methods in the base and derived classes
with the same name and the same
parameters.
 By runtime polymorphism, we can point to
any derived class from the object of the
base class at runtime that shows the ability
of runtime binding.
Example:-
 public class clsShape
 {
 public int _radius = 5;
 public virtual double getArea()
 {
 return 0;
 }
 }
 public class clsCircle : clsShape
 {
 public override double getArea()
 {
 return 3.14 * _radius * _radius;
 }
 }
 public class clsSphere : clsShape
 {
 public override double getArea()
 {
 return 4 * 3.14 * _radius * _radius;
 }
 }
Polymorphism in c# is achieved
by:-
Function Overloading
Operator Overloading
Dynamic Binding
EARLY
BINDING
It refers to the ability of the compiler to relate
or bind a function definition during
compilation itself.
FUNTION OVERLOADING and
OPERATER OVERLOADING comes under
this category.
LATE
BINDING
It refers to the binding of a function call with
the function definition during Run-time.
It uses the concept of POINTERS and
INHERITENCE.
Achieving Polymorphism
POLYMORPHISM
COMPILE TIME
/ STATIC /
EARLY
BINDING
FUNCTION
OVERLOADING
OPERATOR
OVERLOADING
RUNTIME /
DYNAMIC /
LATE BINDING
VIRTUAL
FUNCTION
THANK YOU

More Related Content

PPTX
Polymorphism
Ahmed Za'anin
 
PPTX
Polymorphism
Nochiketa Chakraborty
 
PPTX
Polymorphism presentation in java
Ahsan Raja
 
PPTX
Polymorphism in java
sureshraj43
 
PDF
Polymorphism in oop
MustafaIbrahimy
 
PDF
Polymorphism In Java
Spotle.ai
 
PPTX
Abstract class and Interface
Haris Bin Zahid
 
PPTX
Polymorphism in C# Function overloading in C#
Abid Kohistani
 
Polymorphism
Ahmed Za'anin
 
Polymorphism
Nochiketa Chakraborty
 
Polymorphism presentation in java
Ahsan Raja
 
Polymorphism in java
sureshraj43
 
Polymorphism in oop
MustafaIbrahimy
 
Polymorphism In Java
Spotle.ai
 
Abstract class and Interface
Haris Bin Zahid
 
Polymorphism in C# Function overloading in C#
Abid Kohistani
 

What's hot (20)

PPTX
Polymorphism
Kumar Gaurav
 
PDF
Function overloading ppt
Prof. Dr. K. Adisesha
 
PPTX
Inline function
Tech_MX
 
PPTX
Object Oriented Programming using C++(UNIT 1)
Dr. SURBHI SAROHA
 
PPTX
Java(Polymorphism)
harsh kothari
 
PPTX
Inheritance in c++
Vineeta Garg
 
PPSX
Modules and packages in python
TMARAGATHAM
 
PPTX
Constructor in java
Madishetty Prathibha
 
PPT
Introduction to method overloading & method overriding in java hdm
Harshal Misalkar
 
PPTX
Inheritance in JAVA PPT
Pooja Jaiswal
 
PPT
C++: Constructor, Copy Constructor and Assignment operator
Jussi Pohjolainen
 
PPT
Java interfaces
Raja Sekhar
 
PPTX
Destructors
DeepikaT13
 
PPTX
virtual function
VENNILAV6
 
PPTX
C# Inheritance
Prem Kumar Badri
 
PPT
Class and object in C++
rprajat007
 
PPTX
Friend function & friend class
Abhishek Wadhwa
 
PPT
PHP variables
Siddique Ibrahim
 
PPTX
classes and objects in C++
HalaiHansaika
 
PPTX
Java Tokens
Madishetty Prathibha
 
Polymorphism
Kumar Gaurav
 
Function overloading ppt
Prof. Dr. K. Adisesha
 
Inline function
Tech_MX
 
Object Oriented Programming using C++(UNIT 1)
Dr. SURBHI SAROHA
 
Java(Polymorphism)
harsh kothari
 
Inheritance in c++
Vineeta Garg
 
Modules and packages in python
TMARAGATHAM
 
Constructor in java
Madishetty Prathibha
 
Introduction to method overloading & method overriding in java hdm
Harshal Misalkar
 
Inheritance in JAVA PPT
Pooja Jaiswal
 
C++: Constructor, Copy Constructor and Assignment operator
Jussi Pohjolainen
 
Java interfaces
Raja Sekhar
 
Destructors
DeepikaT13
 
virtual function
VENNILAV6
 
C# Inheritance
Prem Kumar Badri
 
Class and object in C++
rprajat007
 
Friend function & friend class
Abhishek Wadhwa
 
PHP variables
Siddique Ibrahim
 
classes and objects in C++
HalaiHansaika
 
Ad

Viewers also liked (8)

PPTX
Index properties of rocks
Zeeshan Afzal
 
PPTX
Index properties of rocks
Ali Wassan
 
PPTX
polymorphism
Imtiaz Hussain
 
PDF
Engineering rock mechanics volume1
batbold113o
 
PDF
Polymorphism
Raffaele Doti
 
PDF
LinkedIn SlideShare: Knowledge, Well-Presented
SlideShare
 
PDF
Build Features, Not Apps
Natasha Murashev
 
PDF
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
SlideShare
 
Index properties of rocks
Zeeshan Afzal
 
Index properties of rocks
Ali Wassan
 
polymorphism
Imtiaz Hussain
 
Engineering rock mechanics volume1
batbold113o
 
Polymorphism
Raffaele Doti
 
LinkedIn SlideShare: Knowledge, Well-Presented
SlideShare
 
Build Features, Not Apps
Natasha Murashev
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
SlideShare
 
Ad

Similar to Polymorphism (20)

PDF
Learn C# Programming Polymorphism & Operator Overloading
Eng Teong Cheah
 
PDF
Btech chapter notes batcha ros zir skznzjsbaajz z
bhatiaanushka101
 
PPTX
28csharp
Sireesh K
 
PPTX
28c
Sireesh K
 
PPTX
Polymorphism
Ducat India
 
PPTX
Chapter 4
siragezeynu
 
PDF
Java Polymorphism
Soba Arjun
 
PPTX
Polymorphism OOP new Gate.pptx
AssadLeo1
 
PPTX
Polymorphism OOP Old Gate.pptx
AssadLeo1
 
PPTX
OOP - Polymorphism
Mudasir Qazi
 
PPTX
Polymorphism in java
Janu Jahnavi
 
PPTX
Thinking in object oriented - Part 2
Reza Taroosheh
 
PPTX
P.7 media 2 polymorphism
ahmadmuzaqqi
 
PPTX
java polymorphism example program oracal.pptx
pirito8705
 
PPTX
Introduction to java programming polymorphism
bhaskar810658
 
PPTX
OOP- PolymorphismFinal12injavait101.pptx
codevincent624
 
PPTX
java poly ppt.pptx
sukhpreetsingh295239
 
PPTX
Oop lecture 06
University of Chitral
 
Learn C# Programming Polymorphism & Operator Overloading
Eng Teong Cheah
 
Btech chapter notes batcha ros zir skznzjsbaajz z
bhatiaanushka101
 
28csharp
Sireesh K
 
Polymorphism
Ducat India
 
Chapter 4
siragezeynu
 
Java Polymorphism
Soba Arjun
 
Polymorphism OOP new Gate.pptx
AssadLeo1
 
Polymorphism OOP Old Gate.pptx
AssadLeo1
 
OOP - Polymorphism
Mudasir Qazi
 
Polymorphism in java
Janu Jahnavi
 
Thinking in object oriented - Part 2
Reza Taroosheh
 
P.7 media 2 polymorphism
ahmadmuzaqqi
 
java polymorphism example program oracal.pptx
pirito8705
 
Introduction to java programming polymorphism
bhaskar810658
 
OOP- PolymorphismFinal12injavait101.pptx
codevincent624
 
java poly ppt.pptx
sukhpreetsingh295239
 
Oop lecture 06
University of Chitral
 

Recently uploaded (20)

PDF
All chapters of Strength of materials.ppt
girmabiniyam1234
 
PPTX
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PDF
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
PDF
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
PPT
Understanding the Key Components and Parts of a Drone System.ppt
Siva Reddy
 
PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PPTX
Online Cab Booking and Management System.pptx
diptipaneri80
 
PPTX
sunil mishra pptmmmmmmmmmmmmmmmmmmmmmmmmm
singhamit111
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PDF
AI-Driven IoT-Enabled UAV Inspection Framework for Predictive Maintenance and...
ijcncjournal019
 
PPTX
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
PPTX
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
PPTX
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PPTX
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PDF
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
PDF
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
All chapters of Strength of materials.ppt
girmabiniyam1234
 
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
Understanding the Key Components and Parts of a Drone System.ppt
Siva Reddy
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
Online Cab Booking and Management System.pptx
diptipaneri80
 
sunil mishra pptmmmmmmmmmmmmmmmmmmmmmmmmm
singhamit111
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
AI-Driven IoT-Enabled UAV Inspection Framework for Predictive Maintenance and...
ijcncjournal019
 
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 

Polymorphism

  • 1. Present by: Arif Ayoub Ansari
  • 2. POLYMORPHISM:- IT IS DERIVED FROM THE GREEK WORD POLUMORPHOUS POLUS-MANY MORPHE-SHAPE/FORM “HAVING MULTIPLE FORM”
  • 3. It is the ability for a message or data to be processed in more than one form. It is the property by which the same message can be sent to objects of several different classes.
  • 4. Example The message send by ringing the bell in school, is processed in many forms by which we are informed about:- The beginning of the class, End of the class, Beginning of an interval, End of the day’s classes etc.
  • 6. STATIC POLYMORPHISM Static polymorphism is also called as Compile Time polymorphism. In Static polymorphism methods are overloaded with same name but having different signatures. So it is called as method overloading.
  • 7. Static or Compile Time Polymorphism:-  In static polymorphism, the decision is made at compile time.  Which method is to be called is decided at compile-time only.  Method overloading is an example of this.  Compile time polymorphism is method overloading, where the compiler knows which overloaded method it is going to call.
  • 8. Example: -  public class clsCalculation  {   public int Add(int a, int b)  {  return a + b;  }   public double Add(int z, int x, int c)  {  return z + x + c;  }   }
  • 9. DYNAMIC POLYMORPHISM Dynamic polymorphism is also called as Run Time polymorphism. In this type of polymorphism methods have the same name, same signature but different in the implementation. In Dynamic polymorphism methods are overridden so it also called as method overriding.
  • 10. Dynamic or Runtime Polymorphism:  Method overriding allows us to have methods in the base and derived classes with the same name and the same parameters.  By runtime polymorphism, we can point to any derived class from the object of the base class at runtime that shows the ability of runtime binding.
  • 11. Example:-  public class clsShape  {  public int _radius = 5;  public virtual double getArea()  {  return 0;  }  }  public class clsCircle : clsShape  {  public override double getArea()  {  return 3.14 * _radius * _radius;  }  }  public class clsSphere : clsShape  {  public override double getArea()  {  return 4 * 3.14 * _radius * _radius;  }  }
  • 12. Polymorphism in c# is achieved by:- Function Overloading Operator Overloading Dynamic Binding
  • 13. EARLY BINDING It refers to the ability of the compiler to relate or bind a function definition during compilation itself. FUNTION OVERLOADING and OPERATER OVERLOADING comes under this category.
  • 14. LATE BINDING It refers to the binding of a function call with the function definition during Run-time. It uses the concept of POINTERS and INHERITENCE.
  • 15. Achieving Polymorphism POLYMORPHISM COMPILE TIME / STATIC / EARLY BINDING FUNCTION OVERLOADING OPERATOR OVERLOADING RUNTIME / DYNAMIC / LATE BINDING VIRTUAL FUNCTION