SlideShare a Scribd company logo
1 of 16
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

What's hot

Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Michelle Anne Meralpis
 
Polymorphism presentation in java
Polymorphism presentation in javaPolymorphism presentation in java
Polymorphism presentation in javaAhsan Raja
 
Polymorphism in C++
Polymorphism in C++Polymorphism in C++
Polymorphism in C++Rabin BK
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming conceptsrahuld115
 
Introduction to method overloading & method overriding in java hdm
Introduction to method overloading & method overriding  in java  hdmIntroduction to method overloading & method overriding  in java  hdm
Introduction to method overloading & method overriding in java hdmHarshal Misalkar
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in JavaJin Castor
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in JavaSpotle.ai
 
C++ concept of Polymorphism
C++ concept of  PolymorphismC++ concept of  Polymorphism
C++ concept of Polymorphismkiran Patel
 
Function overloading and overriding
Function overloading and overridingFunction overloading and overriding
Function overloading and overridingRajab Ali
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator OverloadingNilesh Dalvi
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member FunctionsMOHIT AGARWAL
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 

What's hot (20)

Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Polymorphism presentation in java
Polymorphism presentation in javaPolymorphism presentation in java
Polymorphism presentation in java
 
Javapolymorphism
JavapolymorphismJavapolymorphism
Javapolymorphism
 
Polymorphism in C++
Polymorphism in C++Polymorphism in C++
Polymorphism in C++
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming concepts
 
Introduction to method overloading & method overriding in java hdm
Introduction to method overloading & method overriding  in java  hdmIntroduction to method overloading & method overriding  in java  hdm
Introduction to method overloading & method overriding in java hdm
 
polymorphism
polymorphism polymorphism
polymorphism
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Looping statements in Java
Looping statements in JavaLooping statements in Java
Looping statements in Java
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
 
Method overriding
Method overridingMethod overriding
Method overriding
 
C++ concept of Polymorphism
C++ concept of  PolymorphismC++ concept of  Polymorphism
C++ concept of Polymorphism
 
Function overloading and overriding
Function overloading and overridingFunction overloading and overriding
Function overloading and overriding
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
 
Oops ppt
Oops pptOops ppt
Oops ppt
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Python-Polymorphism.pptx
Python-Polymorphism.pptxPython-Polymorphism.pptx
Python-Polymorphism.pptx
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
 

Viewers also liked

Index properties of rocks
Index properties of rocksIndex properties of rocks
Index properties of rocksZeeshan Afzal
 
Index properties of rocks
Index properties of rocksIndex properties of rocks
Index properties of rocksAli Wassan
 
Engineering rock mechanics volume1
Engineering rock mechanics volume1Engineering rock mechanics volume1
Engineering rock mechanics volume1batbold113o
 
LinkedIn SlideShare: Knowledge, Well-Presented
LinkedIn SlideShare: Knowledge, Well-PresentedLinkedIn SlideShare: Knowledge, Well-Presented
LinkedIn SlideShare: Knowledge, Well-PresentedSlideShare
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...SlideShare
 

Viewers also liked (8)

Index properties of rocks
Index properties of rocksIndex properties of rocks
Index properties of rocks
 
Index properties of rocks
Index properties of rocksIndex properties of rocks
Index properties of rocks
 
Engineering rock mechanics volume1
Engineering rock mechanics volume1Engineering rock mechanics volume1
Engineering rock mechanics volume1
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
LinkedIn SlideShare: Knowledge, Well-Presented
LinkedIn SlideShare: Knowledge, Well-PresentedLinkedIn SlideShare: Knowledge, Well-Presented
LinkedIn SlideShare: Knowledge, Well-Presented
 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
 

Similar to Polymorphism

Polymorphism in java, method overloading and method overriding
Polymorphism in java,  method overloading and method overridingPolymorphism in java,  method overloading and method overriding
Polymorphism in java, method overloading and method overridingJavaTportal
 
Java Polymorphism: Types And Examples (Geekster)
Java Polymorphism: Types And Examples (Geekster)Java Polymorphism: Types And Examples (Geekster)
Java Polymorphism: Types And Examples (Geekster)Geekster
 
Chapter 05 polymorphism
Chapter 05 polymorphismChapter 05 polymorphism
Chapter 05 polymorphismNurhanna Aziz
 
P.7 media 2 polymorphism
P.7 media 2 polymorphismP.7 media 2 polymorphism
P.7 media 2 polymorphismahmadmuzaqqi
 
البرمجة الهدفية بلغة جافا - تعدد الأشكال
البرمجة الهدفية بلغة جافا - تعدد الأشكالالبرمجة الهدفية بلغة جافا - تعدد الأشكال
البرمجة الهدفية بلغة جافا - تعدد الأشكالMahmoud Alfarra
 
Polymorphism and its types
Polymorphism and its typesPolymorphism and its types
Polymorphism and its typesSuraj Bora
 
Presentstion polymorphism opp Java muet u
Presentstion polymorphism opp Java muet uPresentstion polymorphism opp Java muet u
Presentstion polymorphism opp Java muet uAnjali127411
 
Advance Java Polymorphism OOPS CON .pptx
Advance Java Polymorphism OOPS CON .pptxAdvance Java Polymorphism OOPS CON .pptx
Advance Java Polymorphism OOPS CON .pptxjprince1621
 
Lecture 6 inheritance
Lecture   6 inheritanceLecture   6 inheritance
Lecture 6 inheritancemanish kumar
 
Learn C# Programming Polymorphism & Operator Overloading
Learn C# Programming Polymorphism & Operator OverloadingLearn C# Programming Polymorphism & Operator Overloading
Learn C# Programming Polymorphism & Operator OverloadingEng Teong Cheah
 
Shuvrojit Majumder . 25900120006 Object Oriented Programming (PCC-CS 503) ...
Shuvrojit Majumder .  25900120006  Object Oriented Programming (PCC-CS 503)  ...Shuvrojit Majumder .  25900120006  Object Oriented Programming (PCC-CS 503)  ...
Shuvrojit Majumder . 25900120006 Object Oriented Programming (PCC-CS 503) ...ShuvrojitMajumder
 

Similar to Polymorphism (20)

Polymorphism in java, method overloading and method overriding
Polymorphism in java,  method overloading and method overridingPolymorphism in java,  method overloading and method overriding
Polymorphism in java, method overloading and method overriding
 
Oop lecture 06
Oop lecture 06Oop lecture 06
Oop lecture 06
 
28csharp
28csharp28csharp
28csharp
 
28c
28c28c
28c
 
JAVA_POLYMORPHISM.pptx
JAVA_POLYMORPHISM.pptxJAVA_POLYMORPHISM.pptx
JAVA_POLYMORPHISM.pptx
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Java Polymorphism: Types And Examples (Geekster)
Java Polymorphism: Types And Examples (Geekster)Java Polymorphism: Types And Examples (Geekster)
Java Polymorphism: Types And Examples (Geekster)
 
Chapter 05 polymorphism
Chapter 05 polymorphismChapter 05 polymorphism
Chapter 05 polymorphism
 
P.7 media 2 polymorphism
P.7 media 2 polymorphismP.7 media 2 polymorphism
P.7 media 2 polymorphism
 
Polymorphism in java
Polymorphism in javaPolymorphism in java
Polymorphism in java
 
البرمجة الهدفية بلغة جافا - تعدد الأشكال
البرمجة الهدفية بلغة جافا - تعدد الأشكالالبرمجة الهدفية بلغة جافا - تعدد الأشكال
البرمجة الهدفية بلغة جافا - تعدد الأشكال
 
Polymorphism and its types
Polymorphism and its typesPolymorphism and its types
Polymorphism and its types
 
Presentstion polymorphism opp Java muet u
Presentstion polymorphism opp Java muet uPresentstion polymorphism opp Java muet u
Presentstion polymorphism opp Java muet u
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Advance Java Polymorphism OOPS CON .pptx
Advance Java Polymorphism OOPS CON .pptxAdvance Java Polymorphism OOPS CON .pptx
Advance Java Polymorphism OOPS CON .pptx
 
Lecture 6 inheritance
Lecture   6 inheritanceLecture   6 inheritance
Lecture 6 inheritance
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Learn C# Programming Polymorphism & Operator Overloading
Learn C# Programming Polymorphism & Operator OverloadingLearn C# Programming Polymorphism & Operator Overloading
Learn C# Programming Polymorphism & Operator Overloading
 
polymorphism ppt
polymorphism pptpolymorphism ppt
polymorphism ppt
 
Shuvrojit Majumder . 25900120006 Object Oriented Programming (PCC-CS 503) ...
Shuvrojit Majumder .  25900120006  Object Oriented Programming (PCC-CS 503)  ...Shuvrojit Majumder .  25900120006  Object Oriented Programming (PCC-CS 503)  ...
Shuvrojit Majumder . 25900120006 Object Oriented Programming (PCC-CS 503) ...
 

Recently uploaded

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 

Recently uploaded (20)

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 

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