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 dynamic method dispatch ?

Answer Posted / salman

In dynamic method dispatch,super class refers to subclass object and implements method overriding.
Example:

class Flower {
void which() {
System.out.println("A Beautiful flower.");
}
}
class Rose extends Flower {
void which() {
System.out.println("Rose");
}
}
class Lotus extends Flower {
void which() {
System.out.println("Lotus.");
}
}
class Test {

public static void main(String[] args) {
Flower ref1 = new Flower();
Flower ref2 = new Rose();
Flower ref3 = new Lotus();
ref1.which();
ref2.which();
ref3.which();
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of 'super' keyword inside a constructor?

952


What is object-oriented paradigm?

1048


what is meant by Byte code concept in Java?

1045


What is parsing in grammar?

1028


What is the exact difference in between Unicast and Multicast object? Where will it be used?

1039


how does multithreading take place on a computer with a single cpu? : Java thread

1124


Explain thread in java?

1143


What is a programming object?

1082


Explain about class in java?

1079


Explain importance of inheritance in java?

1003


What are the types of java?

1077


What is byte code and why is it important to java’s use for internet programming?

1106


What if I write static public void instead of public static void in java?

1071


What is the basic difference between string and stringbuffer object?

1068


Why vector is used in java?

1012