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 is instanceof operator used in java?
What are bind parameters?
How do I start learning java?
take an array with -ve and +ve value both.find out the nearest value of 0(zero).if two values are same like(-2 and +2)then extract +2 is nearest of 0(zero).
What are loops in java?
what are the disadvantages of indexes in oracle?
What is meant by stack and queue?
What data type is true or false?
What is a java object and java application?
What are the differences between include directive and include action?
What is thread count in java?
What are the parts of a method?
What is methods and methodology?
What is string in java with example?
What is ternary operator? Give an example.