Saturday, October 28, 2017

Polymorphism

  Polymorphism:
o      Polymorphism is a Greek term which means ability to take more than one form.
o      For example, + is used to make sum of two numbers as well as it is used to combine two strings.
o      This is known as operator overloading because same operator may behave differently on different instances.
o      Same way functions can be overloaded. For example, sum () function may takes two arguments or three arguments etc. i.e. sum (5, 7) or sum (4, 6, 8).

No comments:

Post a Comment