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

What is the difference between imperative and interrogative code?

1581


How will you load an assembly which is not referenced by current assembly?

546


Explain me why do we use msmq?

555


What data providers available in .net to connect to database?

516


What is managed code in .NET?

636






What is the need of OLE-automation?

633


Write the .net syntax for 'for loop'?

564


How is .net able to support multiple languages?

608


What are multicast delegates?

579


Explain garbage collection?

549


Is there built-in support for tracing?

568


What is an assembly? What are the different types of assemblies?

587


Difference between machine.config and web.config?

561


How do we access crystal reports in .net?

579


State the various features present in .NET?

595