0 votes
in JAVA by

What is method overriding in java ?

If we have methods with same signature (same name, same signature, same return type) in super class

and subclass then we say

subclass method is overridden by superclass.

When to use overriding in java

If we want same method with different behaviour in superclass and subclass then we go for overriding.

When we call overridden method with subclass reference subclass method is called hiding the superclass

method.

Related questions

0 votes
asked Jun 16, 2019 in JAVA by reins.robin
+1 vote
asked Jun 17, 2019 in JAVA by reins.robin
...