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

hi
MethodOverriding is the concept which implements Dynamic
Code(Method) binding.
i.e., The method which is going to bind or execute is
decided at the runtime basing on the Object that we are
using to call that method...
Suppose assume we have two Classes A,B Where class B is
inheriting class A.And even we have overridden(given
different implementation with same method signature)a
method of class A in class B.
Now the criteria is which method(superclass method or
subclsas overridden method) is to be called or executed is
determined based on the object(class A object Or class B
object) we are using to call that method............

Is This Answer Correct ?    9 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the ways in which a thread can enter the waiting state?

990


What does singleton mean in java?

1059


What are the different types of data structures in java?

1032


What is a dynamic array java?

990


What does the append?

1056


Does sprintf allocate memory?

1165


What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?

1239


Why 1 is not a prime number?

1076


Difference between == and .equals() ?

1041


What are internal and external variables?

1007


What is static synchronization?

1162


What is the exact difference in between unicast and multicast object? Where we will use?

1042


Can list be null in java?

1098


Can you explain the usages of class.forname()?

1113


What is the difference between overriding & overloading?

1142