what do you meant by Runtime Polymorphism?
Answer Posted / ramkiran
The function which calls at runtime ratherthan the
compiletime
Ex:
Class A
{
Public void test(){
System.out.println(“This is Base Class”);
}
}
Class B extends A{
Public void test(){
System.out.println(“This is Child Class”);
}
}
Class RuntimePoly{
Public static void main(){
A a = new A();
B b = new B();
A baseClassVar;
baseClassVar = a;
baseClassVar.test();
baseClassVar = b;
baseClassVar.test();
}
}
| Is This Answer Correct ? | 30 Yes | 10 No |
Post New Answer View All Answers
What are desktop procedures?
What is ellipsis in java?
What is the private method modifier?
Can we execute a program without main() method?
What is thread synchronization in java?
How many decimal places is a double?
Can a class be private in java?
What is a ternary operator in java? What is an interface?
What is matcher in java?
What is OOP Language?
What is float in java?
What is quick sort in java?
Why is singleton not thread safe?
What about main() method in java ?
How many digits is int32?