James Whitcomb Riley said “When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck.”

This ‘test’ is used as the basis of duck typing.

Sumanth Patlolla

27

8

7

In computer programming with object-oriented programming languages, duck typing is a style of dynamic typing in which an object’s current set of methods and properties determines the valid semantics, rather than its inheritance from a particular class or implementation of a specific interface.

The name of the concept refers to the duck test, attributed to James Whitcomb Riley, which may be phrased as follows:

“When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck.”

duck typing is a style of dynamic typing in which an object’s current set of methods and properties determines the valid semantics, rather than its inheritance from a particular class or implementation of a specific interface. The name of the concept refers to the duck test, attributed to James Whitcomb Riley

jins

james Whitcomb Riley’s comment that if ‘a bird walks and talks like a duck, i call it a duck’, led to duck typing.