IS method overriding is Duplication of Methods?

Answer Posted / amol

No. In method overriding the behaviour of overrided method
is different. The subclass override only those methods,
which has different behaviour than superclass else alawys
use all the methods of superclass, which is better than
making a lot duplication by defining another class for same
methods of superclass.

Is This Answer Correct ?    29 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should we create our own custom exception classes?

600


What is string subsequence method?

641


What is a key in java?

511


How we can skip finally block of exception even if some exception occurs in the exception block in java?

530


Explain differences between collection api and stream api?

619






What are parsing rules?

514


What will happen if a thrown exception is not handled?

571


What is a nested list?

528


How many arguments can be passed to main ()?

532


Is hashset sorted in java?

674


What happens if an exception is throws from an object's constructor?

639


Difference between class#getinstance() and new operator ?

656


why are there separate wait and sleep methods? : Java thread

590


What is the difference between stored procedure & function?

560


What is meant by inheritance and what are its advantages?

587