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
How large is a boolean?
how would you implement a thread pool? : Java thread
Does isempty check for null?
Can a class extend 2 classes in java?
What is difference between Heap and Stack Memory?
What is the difference between a synchronized method and a synchronized block?
What are keyboard events?
What is nullpointerexception?
What is java life cycle?
What method is used to specify a container's layout in java programming?
Describe the process as to how substring() methodology mechanisms in java.
What is the meaning of nullable?
Why are generics used?
What are peerless components in java programming?
Can we extend a class with private constructor?