Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


What is run time polymorphism?

Answers were Sorted based on User's Feedback



What is run time polymorphism?..

Answer / bal

Method overriding is run time poly

Is This Answer Correct ?    37 Yes 4 No

What is run time polymorphism?..

Answer / haridini

At run time it is decided that which version of the same
method should be used. Its basically concept of over
riding.And a very powerful mechanism which is implemented
in java.

Is This Answer Correct ?    23 Yes 4 No

What is run time polymorphism?..

Answer / vijayakumar chinnasamy

Method overrrideing is the runtime polymorphism.The
class's "object" only determine which method to called .
eg:
class SuperClassTest
{
public void display(){
System.out.println("Super class");
}
}
class SubClassTest extends SuperClassTest
{
public void display(){
System.out.println("Sub class");
}
}
public class TestPro {



public static void main(String[] args) {

SuperClassTest sub=new SubClassTest();
System.out.print("I am Calling
subclasstest's display() method: ");
sub.display();

SuperClassTest sup=new SuperClassTest();
System.out.print("I am Calling
superclasstest's display() method: ");
sup.display();
}

}


o/p:

I am Calling subclasstest's display() method: Sub class
Note: object is type of SubClassTest
I am Calling superclasstest's display() method: Super class
Note: object is type of SuperClassTest

Note:
Method overloading is compile time polymorphism.The
class "reference" type determine which method to be called.

Is This Answer Correct ?    13 Yes 0 No

What is run time polymorphism?..

Answer / guest

In Runtime polymorphism the JVM will decide which version
of the method supposed to used.

for example
class Animal{
public void speak(){
System.out.println("Animal speak method callinfg");
}
}

public class Dog extends Animal{
public void speak(){
System.out.println("Dog speak method calling");
}

public static void main(String args[]){

Animal a = new Dog();

a.speak();// u r calling now Animal class speck metod.
}
}
here JVM will decide to execute Dog version of speck
method . This is called runtime polimorphism

thanks
prasad thota

Is This Answer Correct ?    13 Yes 4 No

What is run time polymorphism?..

Answer / tntrichy

Hi Bal, Virtual Function concept in Java, i.e, assigning
sub-class object in super-class's reference.

Is This Answer Correct ?    7 Yes 7 No

What is run time polymorphism?..

Answer / ravikiran

overriding

Is This Answer Correct ?    6 Yes 10 No

Post New Answer



More Core Java Interview Questions

How many types of classes are there in java?

0 Answers  


How do you convert an int to a double in java?

0 Answers  


How do you sort a list in java?

0 Answers  


Explain the init method?

0 Answers  


What is a default constraint?

0 Answers   HCL,






Can you give names of Container classes?

0 Answers   Ordain Solutions,


Can a final variable be manipulated in java?

0 Answers  


How to do a true java ping from windows?

0 Answers  


Difference between process and thread?

0 Answers   HP,


How can I become a good programmer?

0 Answers  


What is split return?

0 Answers  


explain autoboxing in java?

0 Answers  






Categories