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
How do you check if a string is lexicographically in java?
What is the difference between compare and compareto in java?
What is the base class for error and exception?
How does a for loop work?
what is nested class in java?
What is the difference between class & object?
What does java final mean?
What is difference between equals and hashcode method?
What is the size of arraylist in java?
hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea
What are byte codes?
What does I ++ mean?
What does a boolean method return?
Explain oops concepts in detail?
What is collection sort in java?