Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is run time polymorphism?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you declare an empty string?

1062


Is void a data type in java?

986


What are the 8 primitive data types in java?

1017


Can we override final method?

1007


List the three steps for creating an object for a class?

964


What are local variables?

1053


What is sorting algorithm in java?

1070


What is set string?

1176


What is the role of the java.rmi.naming class?

1069


Why destructor is not used in java?

971


What is object cloning in Java?

1104


How to make a class or a bean serializable?

970


What data type is a string?

1010


What is difference between add() and addelement() in vector?

1530


Explain about method local inner classes or local inner classes in java?

1025