Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What are streams?

1058


Can we use String with switch case?

1108


Why is a string immutable?

939


Can we declare an interface as final?

992


Why we use protected in java?

932


Can static methods be inherited?

983


What is the most important feature of java? What is an interface?

953


What is dynamic binding(late binding)?

975


How many types of methods are there?

972


Can a static class implement an interface?

1052


What are java packages? What's the significance of packages?

1221


What is the use of bufferedreader?

951


what is the purpose of using rmisecuritymanager in rmi?

916


Differentiate between static and non-static methods in java.

996


Can finally block be used without a catch?

929