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 data type in computer?
what is comparable and comparator interface?
What is boolean example?
What is the syntax and characteristics of a lambda expression? Explain
What is the similarity between dynamic binding and linking?
What are instance variables?
How does arrays sort work in java?
Is main a keyword in java?
Which are different kinds of source code?
State the difference between creating string as new () and literal.
Which number is denoted by leading 0x or 0x in java?
Is a boolean variable?
What is a null check?
What are the types of sockets in java?
What is integer parseint?