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


Please Help Members By Posting Answers For Below Questions

What do you mean by flow of struts?

741


What is a variable in java?

531


what do you mean by classloader in java?

568


What is java full form?

527


Why inputstreamreader is used in java?

546






There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?

997


Convert Binary tree to linked list.

588


List some important features of java 10 release?

513


How big is a gigabyte?

613


Differences between traditional programming language and object oriented programming language?

570


Why are lists ordered in java?

545


Can we make a constructor final?

543


If two threads have same priority which thread will be executed first ?

842


Will set allow duplicates in java?

501


What is the format specifier?

516