L18 New Polymorphsim - Part1
L18 New Polymorphsim - Part1
Polymorphism means the ability to take on many forms, The term is applied both to objects
and to operations.
Polymorphism is tightly coupled to inheritance and is one of the most powerful advantages to
object-oriented technologies.
Polymorphism is a Greek word that means Many Shapes.
It has four classes with one method print.
Which print about Shape, Circle,
Rectangle and Star
Earlier we studies two types of
polymorphism. They are:
Overloading
Overriding
Different forms of Polymorphism
Early binding
Late binding
Early Binding
This form of polymorphism is called early-binding (or compile-time) polymorphism. That is,
after the compile process when the code is now in byte-code form, the computer will “know”
which of the add methods it will execute.
Late Binding
Example :
Output :
?