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 / deepti sharma

Dynamic method dispatch or run time polymorphism is a property by which methods to be called are resolved at runtime.First create super class reference variable in its subclass and an object of both super and sub class and then assign the sub class object to its super class reference variable.
For ex: Class A{
void add();}
Class B extends A{
void add();}
Class C{
p.s.v.m(String args[]){
A a=new A();
B b=new C();
A r;
r=b;
r.add();//call Class B's add method
}}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can the checkbox class be used to create a radio button?

1023


Can we override constructors in java?

1109


What is int lol?

1123


Can set contain duplicates?

982


What is another word for methodology?

1001


How do you know if a value is nan?

1045


What is the use of volatile in java?

1038


What is a parameter used for?

949


Explain creating threads by implementing runnable class?

1144


What is difference between calling start() and run() method of thread?

1110


What are different data structures in java?

1024


In java, what is the difference between method overloading and method overriding?

1100


What advantage do java's layout managers provide over traditional windowing systems?

944


What is meant by class and object in java?

1018


What are the differences between wait() and sleep()?

993