0% found this document useful (0 votes)
11 views10 pages

Group 4 Oop - Polymorphism

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views10 pages

Group 4 Oop - Polymorphism

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

GROUP 4

PRESENTATION
ANN CLAUDINE D. SURAL
ALEXIS D. MODESTO
RAIZA V. MENDOZA
MARIEL DELOS SANTOS
CYRA JANE O. BAYOBO
ALLAN ALAPIDE
MAY ANN AMGTANGOB
WHAT IS
POLYMORPHISM?
POLYMORPHISM
Is one of the core concepts of object-oriented
programming (OOP) that describes situations in
which something occurs in several different forms.
The word “polymorphism” means having many
forms. In simple words, we can define java
polymorphism as the ability of a message to be
desplayed in more than one form.
ANN CLAUDINE D. SURAL
CONCEPTS OF
POLYMORPHISM
Polymorphism is a fundamental concept in object-
oriented programming that allows objects of
different classes to be treated as objects of a
common superclass. This enables methods to
take on multiple forms, providing flexibility and
code reuse.
ANN CLAUDINE D. SURAL
TYPECASTING

Polymorphism in programming refers to the ability of an


object to take on multiple forms or types. One specific
kind of polymorphism is typecasting, where an object of
one class can be treated as an object of a related class.
This allows for flexibility in how objects are used and
enables code reuse across different but related classes.

ALLAN ALAPIDE
ALEXIS D. MODESTO

KINDS OF
POLYMORPHISM
Polymorphism in programming refers to the ability of objects of
different classes to respond to the same method call.
The main kinds of polymorphism are;
1. Subtype polymorphism - where a subclass can override a method
from its parent class to provide its own implementation.
2. Parametric polymorphism - where a single function or class can
work with data of different types, specified as parameters or type
arguments.
3. Coercion polymorphism - where an object of one type can be
treated as an object of a related type, such as when an integer is
treated as a floating-point number.
Different Types of
Polymorphism
 Static or Compile time • Dynamic Polymorphism
 This type happens when you  A method in a subclass
have multiple methods with overrides a method in the
the same name but different superclass. The method that
parameters in the same gets called is decided when
class. Method that gets called the program runs. This type
is decided when the code is of polymorphism achieved by
compiled. function overloading or
operator overloading. But,
Java doesn’t support the
operator overloading.
CYRA JANE O. BAYOBO
MAY ANN AMGTANGOB
Advantages &
Disadvantages
of POLYMORPHISM
RAIZA V. MENDOZA

Advantages
• It helps programmers reuse the code and classes once written, tested
and implemented. They can be reused in many ways.
• Single variable name can be used to store variables of multiple data
types (Float, Double, Long, Int and etc.)
• Polymorphism helps in reducing the coupling between different
functionalities.
MARIEL DELOS SANTOS

Disadvantage
s
• One of the disadvantags of polynomorphism is that developers
find it difficult to implement polymorphism in codes.
• Run Time polymorphism can be lead to the performance issue as
machibe needs to decide which method or variable to invoke so it
basically degrades the performances as decisions are taken at
run time.
• Polymorphism reduces the readability of the program. One needs
to identify the runtime behavior of the program to identify actual
execution time.
THANK
Basta CICT, QUALITY!!!
YOU!!!
BS COMPUTER SCIENCE – 2D

You might also like