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...

what is the purpose of method overriding in java where v r
completely re-defining a inherited method instead y can't v
create a new method and define.If the question is very silly
plz excuse me and do reply.Thank U!

Answer Posted / kv

The answer lies in Object Oriented concept. When you are
overriding a method, you overriding the internal details of
default behavior. But your interface to external world is
not changed. Example, Base class employee has a method
commuteToWork(). All the manager in the company has given
the company car and a driver. Their implementation of
commuteToWork will be different from the non manager
employees. If you add a new method saying
commuteToWorkByCar(), every Monday morning you would need to
call different method for each subtype of employee. Hope it
will help.

Is This Answer Correct ?    13 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What all access modifiers are allowed for top class ?

1138


What is the purpose of the wait(), notify(), and notifyall() methods in java programming?

1001


What is the difference between an inner class and a sub-class?

941


Explain the difference between intermediate and terminal operations in java8?

1043


What is abstract class? Explain

976


Can an abstract class be a final class?

915


What is passed by reference and pass by value ?

984


What does three dots mean in java?

1059


What is a percentage sign called?

1048


What are wrapped classes in java programming?

1018


Explain about anonymous inner classes in java?

1000


What do you mean by composition in java?

950


What do you mean by byte code?

955


What are void methods?

979


How is java created?

887