by, 04-26-2012 at 06:57 PM (531 Views)
Polymorphism is considered as an objectís ability so that it could take on various forms. It is most commonly used in OOP where parent class reference usually refers the child class objects.
Any java object that can pass more than one IS-A test is considered to be polymorphic. In Java, all java objects are polymorphic since any object will pass the IS-A test for their own type and for the class Object.
It shall be known that objects are access by one single way and that is via reference variable. There is just one kind of reference variable. Variables are not changeable, once reference type is declared.
It is possible to re-assign the reference variable to other objects in case final declaration has not been done. Reference variable type will be determining the methods that may be invoked at the object.
Any object, of declared type, or subtype can be referred by a reference variable.It is possible to declare the reference variable as interface type or class.