Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 28th, 2006, 08:12 AM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to pavanonforums
Default need of polymorphism?

hi this is pavan new to his group and I have justcompleted my MCA and looking for opening.I attended for 3 interviews the common question they asked is
what is the use of polymorphism?give one suitable realtime example?

please help me


thanks in advance


Reply With Quote
  #2 (permalink)  
Old October 30th, 2006, 07:23 AM
Friend of Wrox
 
Join Date: Jan 2006
Location: Fort Wayne, Indiana, USA.
Posts: 103
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Geo121
Default

Well this disappoints me . . .
You have a masters in computer science or computer applications yet you aren't sure of a suitable answer for polymorphism???

Well . . . I will help you out.

Polymorphism is one of the most important and most valuable concepts of programming.
Polymorphism literally means "many forms".
which means the data can be represented in multiple forms.
Even though classes are derived or inherited from the same parent class, each derived class will have its own behavior.
Polymorphism is a concept linked to inheritance and assures that derived classes have the same functions even though each derived class performs different operations.
An example would be if you had a class animal
all animals comunicate in some form just i different ways so you would have an abstract function declared in the parent class talk()
This function will now use polymorphism by example of a dog the dog would inherit this function talk but the dogs talk() function would be different.
animal.talk()
{
    cout << "spoke";
}
dog.talk()
{
    cout << "bark";
}
I hope this helps you but I am kinda upset of course your subject is kinda generalized I don't think a master of computer science should be getting advice on how to pass an interview from an 17 year old high school student. Sorry if this is rude but its just my opinion and doesn't matter right?

 ~ Geo
Reply With Quote
  #3 (permalink)  
Old October 30th, 2006, 07:26 AM
Friend of Wrox
 
Join Date: Jan 2006
Location: Fort Wayne, Indiana, USA.
Posts: 103
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Geo121
Default

http://p2p.wrox.com/topic.asp?TOPIC_ID=51529

above is a link to a form subject that is using a little bit of polymorphism

it's not the best example because it has an error and it is not the best example of polymorphism but this is still a good start

 ~ Geo
Reply With Quote
  #4 (permalink)  
Old December 7th, 2016, 05:19 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Polymorphism

This may Help : Polymorphism
Thanks!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with Polymorphism Piash Java Basics 1 August 8th, 2007 05:24 AM
What is Interface Polymorphism in C#? ramk_1978 C# 1 May 3rd, 2006 01:23 AM
Polymorphism->overloading? naveen J2EE 2 October 19th, 2005 02:34 AM
Polymorphism with Interfaces digby_dog VB.NET 2002/2003 Basics 2 May 11th, 2005 12:50 PM
Polymorphism and Casts g_r BOOK: Beginning Java 2 1 July 13th, 2003 08:38 AM



All times are GMT -4. The time now is 11:44 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.