BSIT 204
OBJECT ORIENTED
PROGRAMMING
TOPIC #3
POLYMORPHISM
What is Polymorphism ?
Polymorphism is a concept in
object-oriented programming
where objects of different
classes can respond to the same
message (method call) in their
own unique way.
BSIT 1
Why is Polymorphism important?
• Polymorphism makes your
code more flexible and
adaptable to changes. You can
add new classes without
affecting existing code.
• By using polymorphism, you
can create more generic and
reusable code.
• Polymorphic code is often
easier to read and maintain
BSIT 4
Example of Polymorphism
• The code exemplifies polymorphism
as Dog and Cat override the speak
method from the base class Animal,
providing their unique
implementations.
• This allows objects of different types
to respond to the same message
(speak) in their own distinct way,
showcasing the core concept of
polymorphism. This flexibility BSIT 4
THANK YOU!
BSIT 172
OBJECT ORIENTED
PROGRAMMING

OOP ACTIVITY - Polymorphismoiiuuyiuyiiii

  • 1.
  • 2.
    What is Polymorphism? Polymorphism is a concept in object-oriented programming where objects of different classes can respond to the same message (method call) in their own unique way. BSIT 1
  • 3.
    Why is Polymorphismimportant? • Polymorphism makes your code more flexible and adaptable to changes. You can add new classes without affecting existing code. • By using polymorphism, you can create more generic and reusable code. • Polymorphic code is often easier to read and maintain BSIT 4
  • 4.
    Example of Polymorphism •The code exemplifies polymorphism as Dog and Cat override the speak method from the base class Animal, providing their unique implementations. • This allows objects of different types to respond to the same message (speak) in their own distinct way, showcasing the core concept of polymorphism. This flexibility BSIT 4
  • 5.
    THANK YOU! BSIT 172 OBJECTORIENTED PROGRAMMING