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
Is overriding possible in java?
What is the static variable?
What are the basic concepts of OOPS in java?
How do listeners work?
How many types of keywords are there?
What is treeset in java?
What does index mean in java?
What are the types of inner classes (non-static nested class) used in java?
Why is an interface be able to extend more than one interface but a class can’t extend more than one class?
What will be the default values of all the elements of an array defined as an instance variable?
What is an empty list in java?
What are the advantages of unicode?
What flag up means?
What is a default constraint?
What is abstraction in java?