IS method overriding is Duplication of Methods?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
Answer / naveen kumar raavi
No.In subclass we will extend the functionality of super
class method.
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / sampada
yes and no.yes overiding is duplication of signatue only
but not implentation is duplicated.subclass gives diff
implementation of it.
| Is This Answer Correct ? | 3 Yes | 1 No |
Explain the key functions of data binding?
0 Answers Akamai Technologies, Aspire, Impetus, Infogain, Tavant Technologies, Virtusa,
Why only one Class is public in one file? Explain in details. Thanks in Advance.
What is the length of a string?
What is singleton class in ruby?
How can we make copy of a java object?
What are order of precedence and associativity, and how are they used?
write a program to create an arraylist and listeterator.and value should be enter through keyboard.
what are the differences between final,finally,finalize methods?
How many techniques can be employed to create a string object?
What does opcode mean?
What happens when I use / and % with a negative numerator?
What loop means?