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 dispatch in java?

Answer Posted / jamia hamdard

Dynamic method dispatch is polymorphism!

we create object dynamically like:

animal ani = new animal();

If there are two different classes 'dog' and 'horse' that inherit from the class 'animal', then we can assign the 'object' of these two classes to the reference variable 'ani' made above. like:-

animal ani = new dog();//since dog inherits from animal.
or
animal ani2 = new horse();//since horse inherits from animal.

polymorphism is same name and having different signatures like 'dog' and 'horse' both are animals.
Its use is to make polymorphic arrays which stores Objects of different classes. The type of the array is that of the 'super class' which is 'animal' here.

thanks!!

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a function for palindrome and factorial and explain?

1078


What is a dot notation?

1035


What is jit compiler in java?

1108


How to display all the prime numbers between 1 and 100

1016


Differentiate between the constructors and methods in java?

947


What is difference between next () and nextline () in java?

992


Why can we not override static method?

1106


How many arguments can be passed to main ()?

995


What is arrays sort in java?

966


What is classes in java?

942


Is null a string in java?

1079


how to one war file class to another war file class?

2077


What is the point of java?

1024


What is widening and narrowing in java? Discuss with an example.

1040


What are Normalization Rules? Define Normalization?

1055