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

How do you classify Dialog Box?

1109


What do you mean by an object in java?

1122


Explain the available thread states in a high-level?

956


What do you mean by Function Overloading in java?

1172


Given a singly linked list, determine whether it contains a loop or not without using temporary space?

977


How many boolean functions are there?

955


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

1035


Can we have try block without catch block?

1023


Can we extend a class with private constructor?

1002


What is ph and buffers?

996


Is java util list serializable?

923


What about abstract classes in java?

1055


How do you escape json?

992


Is minecraft 1.15 out?

972


What is treeset and treemap in java?

1063