Features of object oriented programming :
Polymorphism in Java:
Polymorphism meaning many forms.In real world let us take cameleon, it will change color according to the color of the substance it is sticking to .It has the capability to occur in many colors(forms). Likewise in object oriented programming, few operators or functions will occur in many forms.
For example,consider the operator +,
1. when used along with numbers ,it will add the number
3+3=6
2. when used with strings, it will concatenate the strings
"Java" + "onlinehub" = javaonlinehub
Methods declared in interface, will be implemented in different forms by the implementing classes.[ Will discuss about interface in upcoming posts]
Polymorphism in Java:
Polymorphism meaning many forms.In real world let us take cameleon, it will change color according to the color of the substance it is sticking to .It has the capability to occur in many colors(forms). Likewise in object oriented programming, few operators or functions will occur in many forms.
For example,consider the operator +,
1. when used along with numbers ,it will add the number
3+3=6
2. when used with strings, it will concatenate the strings
"Java" + "onlinehub" = javaonlinehub
Methods declared in interface, will be implemented in different forms by the implementing classes.[ Will discuss about interface in upcoming posts]
Sign up here with your email
ConversionConversion EmoticonEmoticon