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

What is the purpose of the file class in java programming?

1089


What is the main method java?

1079


Is it safe to install java on my computer?

1223


What is a hashmap used for?

1303


What is the map interface in java programming?

1050


What was java originally called?

998


Explain different types of wrapper classes in java?

1070


Why java is used everywhere?

1055


Why unicode is important?

975


What is the platform?

1049


hr interview how many minutes asking question

2087


What is an class?

1088


Why there is no call by reference in java?

973


Can a constructor be private and how are this() and super() method used with constructor?

1047


How many bits is a string in java?

1072