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 / sridharan

We know method overriding will be coming in inheritance.
Consider a mother and her daughter.
Lets think mothers will cook, so her daughter will also
cook. One day mother cooked a biryani for her daughter. By
using the method

cookBriyani(rice,vegetables,water,salt). {

// mother style of cooking
}
But her daughter didn’t like it. So her daughter decided to
prepare biryani by herself. She is also going to use same
ingredients but she is going to prepare in her style.
Daughter method is

cookBriyani(rice,vegetables,water,salt){
// daughter style of cookling
}
Daughter made also biryani so without changing the
name i.e cookBriyani(), also she used same ingredients (i.e
rice,vegetables,water,salt) i.e same parameter but she
prepared in different style.

Is This Answer Correct ?    67 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What data type is true or false?

991


Which non-unicode letter characters may be used as the first character of an identifier?

961


Can we override a variable in java?

945


Why unicode is important?

892


Is void a wrapper class?

885


What is bubble sorting in java?

993


What are the advantages of assembly language?

875


What’s the difference between constructors and other methods?

933


How can you say java is object oriented?

1006


What is annotation in java?

996


What are the differences between the constructors and methods?

1041


What are predefined functions?

1061


how to create multithreaded program? : Java thread

895


What is arraylist e in java?

1001


Why to use nested classes in java?

1040