IS method overriding is Duplication of Methods?
Answer Posted / venkat
To understand the Question, one needs to know the scenarios
where in a method is overriden.
there are two cases:
you want to override a method:
1)when the super class doesnt know how to implement it, and
leaves the implementation to the sub-class.
2)when the subclass feels, it has to add few more details
specific to itself than which are provided by the
superclass.
so there is no duplication happening provided one overrides
a method sensibly(understanding thorougly if overriding a
method is necessary or not).if one wishes to write things
that are already available, it is then called "duplication
of code",
| Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
State the main difference between c++ and java?
What exactly is methodology?
If a class is declared without any access modifiers, where may the class be accessed in java programming?
What invokes a thread's run() method in java programming?
Difference between comparator and comparable in java?
What do you mean by pointer value and address?
What are the benefits of immutable objects?
What is return keyword in java?
What is the maximum length of a url?
What is identifier give example?
Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?
What is number data type in java?
What is a function argument in java?
how many types of Inheritance?
How do you declare a variable?