Professional Documents
Culture Documents
METHOD OVERRIDING
BY
Jenishiya M
... }
Definition
If subclass (child class) has the same
method as declared in the parent class, it is
known as method overriding in Java.
Usage of Method Overriding
Method overriding is used for achieving
01 run-time polymorphism.
4 5. 6.
If a method cannot be Instance methods can The return type should be
inherited, then it be overridden only if the same or a subtype of
the return type declared in
cannot be overridden. they are inherited by
the original overridden
the subclass.
method in the superclass.
} ..
{ ..
THANK
YOU
} ..