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
What is the difference between imperative and interrogative code?
How will you load an assembly which is not referenced by current assembly?
Explain me why do we use msmq?
What data providers available in .net to connect to database?
What is managed code in .NET?
What is the need of OLE-automation?
Write the .net syntax for 'for loop'?
How is .net able to support multiple languages?
What are multicast delegates?
Explain garbage collection?
Is there built-in support for tracing?
What is an assembly? What are the different types of assemblies?
Difference between machine.config and web.config?
How do we access crystal reports in .net?
State the various features present in .NET?