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.What is the major advantage of polymorphism? Please don't
simply say binding. Specify any other reason.

Answer Posted / ashutosh

the main reason to use polymorphism is generalization, as
you can see in case of overloading. say if i have add
function which just add two intergers. and i have one more
similar kind of functionality then in that case i will do
the overloading as only my internal implemantation will
vary.

second thing is consistency in code.

and in case of overriding main advantage is you can invoke
child class function dynamically(means by creating the
object of base class as normally we do).

suppose one of my function expects my base class type
object and i want functionality of overrided function then
in that case i can simply write (parent obj = new child();)

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell us what is the native image generator?

1261


What is the difference between a class and an object, and how do these terms relate to each other?

1071


How inheritance works in .net?

1108


Explain the difference between managed and unmanaged code?

970


What is namespaces in .net?

1212


What does cil do?

1062


Please explain what garbage collection is and how it works. Provide a code example of how you can enforce garbage collection in .net?

1053


How many types of generations are there in a garbage collector?

1027


what is the keyword used for self reference?

2453


What is immutability?

1080


How we can achieve Connection pooling in .Net?

1140


What is a strong name in .net?

1102


Explain what is an anonymous method and how is it different from a lambda expression?

1021


What is difference between .net and .net core?

1054


How many namespaces are in .net version 1.1?

1198