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
When should we create our own custom exception classes?
What is string subsequence method?
What is a key in java?
How we can skip finally block of exception even if some exception occurs in the exception block in java?
Explain differences between collection api and stream api?
What are parsing rules?
What will happen if a thrown exception is not handled?
What is a nested list?
How many arguments can be passed to main ()?
Is hashset sorted in java?
What happens if an exception is throws from an object's constructor?
Difference between class#getinstance() and new operator ?
why are there separate wait and sleep methods? : Java thread
What is the difference between stored procedure & function?
What is meant by inheritance and what are its advantages?