what is dynamic method dispatch ?
Answer Posted / yayati pavan kumar
Ex:
class A
{
public void m1()
{}
}
class B extends A
{
public void m1()
{
}
main()
{
A a=new B();//B reference will be assign at run time
a.m1();//class B method m1() will be called at runtime
}
}
| Is This Answer Correct ? | 80 Yes | 18 No |
Post New Answer View All Answers
What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?
What is an iterator java?
What is boolean false?
What is stringbuffer in java?
What is regex in java?
What is method in java ?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?
Why are parameters used in functions?
what is interface in java? Explain
why are there separate wait and sleep methods? : Java thread
Difference between final and effectively final ? Why is effectively final even required ?
What is equlas() and hashcode() contract in java? Where does it used?
Explain serialization and deserialization in java?
What does serializing data mean?
Which container method is used to cause a container to be laid out and redisplayed in java programming?