Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 10
    "the ability for an object of type A to behave like an object of type B" - it's not accurate definition. I would say it's more like the ability to treat an object of type A like it's an object of type B. Commented Jun 23, 2009 at 8:27
  • Yes. Maybe that is a better phrasing. Commented Jun 23, 2009 at 8:37
  • For completeness, many language implement polymorphism through duck typing, e.g. Python. Commented Jun 29, 2009 at 16:40
  • I wonder how is this related to the (popular) explanation that @Ajay Patel gave classes have different functionality while sharing a common interface Commented May 5, 2014 at 10:46