CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES C++ DETAILS
Question :
What is polymorphism? Explain with an example?



Category C++ Interview Questions
Rating (4.0) By 1 users
Added on 7/19/2006
Views 2843
Rate it!
Answers:

Polymorphism is "acquiring many forms". as it has been stated that c++ has the property of polymorphism.Like as someone said the eg of vehicle...it can be said that the particular operation can acquire one or many forms



Its Ablity to take more than one form



 Posted by: anjana    

Contact anjana  Contact anjana

It allows single name or operator to perform different operations depending on datatype passed to it... operator overloading, function over loading...



 Posted by: anu    

Contact anu  Contact anu

polymorphism in c++ context means the ability of an object to perform different tasks with a single/similar function call.



 Posted by: vikas bhat    

Contact vikas bhat  Contact vikas bhat

polymorphism means single interface or name , multiple methods



 Posted by: aravindan    

Contact aravindan  Contact aravindan

Taking example is the best way to explain..
polymorphism means of many forms..

so in C++ context one function many forms...

In C we can not have 2 function with same name so we have to remember each functions name every time we are creating new one even if they are doing same task

But C++ removes this disadvantage by introducing polymirohism....

you have function lets say addint() adding 2 integers & other addfloat() adding 2 floats.

so even if both are doing addition of data types in C we have to keep their name deifferent!!!!!!!

But in C++ we can have only one function name add(int,int) & add (float,float)due to polymorphism

compiler will invoke appropriate function according to function call (this is called static polymorphism some times..)why???? tell me.....

other called run time polymorphism read virtual function for that....





 Posted by: Mihir P Trivedi    

Contact Mihir P Trivedi  Contact Mihir P Trivedi


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
What is a class?


View Answer
What is the difference between structures and classes in C++?
View Answer
What is an object?


View Answer
What is the difference between class and structure?


View Answer
We can overload assignment operator as a normal function.But we can not overload assignment operator as friend function why?



View Answer
What are virtual functions?


View Answer
What is the Basic nature of "cin" and "cout" and what concept or principle we are using on those two?

View Answer
What is a scope resolution operator?


View Answer
What do you mean by inheritance?


View Answer
What is the difference between an object and a class?


View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL C++ Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/6148/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.69