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


Please Help Members By Posting Answers For Below Questions

How do you check if a string is lexicographically in java?

503


What is the difference between compare and compareto in java?

491


What is the base class for error and exception?

557


How does a for loop work?

509


what is nested class in java?

603






What is the difference between class & object?

558


What does java final mean?

522


What is difference between equals and hashcode method?

574


What is the size of arraylist in java?

609


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

1465


What are byte codes?

659


What does I ++ mean?

613


What does a boolean method return?

633


Explain oops concepts in detail?

580


What is collection sort in java?

559