✏️ Explanatory Question

What is the main benefit of Polymorphism?

👁 21 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation

Polymorphism allows the same method name to behave differently based on the object calling it.

Benefits:

  • Flexibility in code

  • Extensibility

  • Clean and maintainable programs

Example:
A method makeSound() behaves differently for Dog, Cat, and Cow.