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...

1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE
VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO
ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT
RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE
VARIABLE" HERE?

Answer Posted / vijay kumar

In case of dynamic method dispatch, It restricts from being used to call methods of other class. You cannot call overriden method which is not declared in reference variable class..
This is the main reason why we use reference variable here in dynamic polymorphism.

Hope i answer this question.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can Exception handling we can handle multiple catch blocks?

978


What is ide with example?

910


What are the concepts of 'OOPS'?

1021


How do you sort a string in java?

902


What is boolean logic?

968


Does .length start 0 java?

956


What is application tier?

1044


What is the difference between processes and threads?

992


When can an object reference be cast to an interface reference in java programming?

955


Are static members inherited to sub classes?

1088


Why set do not allow duplicates in java?

1002


What is a protected class in java?

937


What is java oops?

995


Explain about map interface in java?

944


How do you implement polymorphism in our day to day life?

3173