Polymorphism:

  • It allows objects of different classes to be treated as objects of a common superclass.
  • Example: A method drive() can be defined in both Car and Bike classes, and a function can call drive() without knowing the specific type of the object.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *