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
What is the use of runnable interface?
How list contains works in java?
When do we use synchronized blocks and advantages of using synchronized blocks?
What is the intersection and union methods?
What are the types of relation?
Is it possible to instantiate the abstract class?
What does i ++ mean in Java?
Can inner class have constructor?
What is the difference between yielding and sleeping?
What is qms certification?
What does flag mean in java?
What is the difference between abstract classes and interfaces?
When will we prefer to use set and list in java and why?
Why is java so popular?
Why can't we use static class instead of singleton?