what is dynamic method dispatch ?
Answer Posted / md arifulla
dynamic dispatch is nothing but run time polymorphism ,
for example if we take a reference variable of super class
and the abject of sub class is assigned to the reference of
super class
ex:
class A
{
print()
{
System.out.println("class A");
}
}
class B extends A
{
print()
{
System.out.println("class B");
}
}
class C{
public static void main(String srgs[])
{
A a=new A();
B b;
b=a;
a.print();//invokes the print of class A
}
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the static variable?
What is class forname?
How do you create immutable object in java?
Explain naming conventions for packages?
What is javac used for?
How do you reverse sort a list in java?
What is ‘has a’’ relationship in java?
Why is boolean important?
What is multiple inheritance? Is it supported by java?
Similarity and difference between static block and static method ?
What are constructors in java?
What is files manifesting?
What is the relationship between clipping and repainting under awt?
What are java methods?
Define an applet in java?