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

How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?

559


Can a method be overloaded based on different return type but same argument type?

546


Write a java program for binary search?

611


what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread

499


What 4 doubled?

544






What is a Transient Object?

639


What is type conversion in java?

581


if u open login & logout ,how can udisplay the timelogin & logout members ?

1756


When we serialize an object does the serialization mechanism saves its references too?

508


Explain tree set and its features?

599


explain the difference between jdk and jvm?

562


Where pragma is used?

601


Is string serializable in java?

545


Why do we use variables?

516


What is the use of set in java?

612