473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

what is polymorphism?

what is polymorphism?

May 18 '06 #1
18 1979
polymorphism, means a single handle to some data in compilation time
can be of different types during runtime. Right?

May 18 '06 #2
voidtwerp wrote:
what is polymorphism?


Read section 20 of the FAQ:
<url: http://www.parashift.com/c++-faq-lite/virtual-functions.html>

--
Alan Johnson
May 18 '06 #3
Geo

voidtwerp wrote:
what is polymorphism?


poly - More than one; many; much
morph - One of various distinct forms
ism - A distinctive doctrine, system, or theory

or

polymorphism -
In object-oriented programming, the term is used to describe
a variable that may refer to objects whose class is not
known at compile time and which respond at run time
according to the actual class of the object to which they
refer.

source : Dictionary.com

May 18 '06 #4

miya wrote:
http://en.wikipedia.org/wiki/Polymor...mputer_science)


Wow...when I was in college I had to do my own research. Kids have it
so easy now...

May 18 '06 #6
voidtwerp wrote:
what is polymorphism?


Polymorphism is being able to plug more than one kind of electrical
appliance into a wall socket.
Socks

May 18 '06 #7
heh - thats more like the response i was expecting ;)

May 18 '06 #8
> Polymorphism is being able to plug more than one kind of electrical
appliance into a wall socket.
Socks


I mean - heh - thats more like the kinda response i was expecting -
dang google groups

May 18 '06 #9
"voidtwerp" <vo*******@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
what is polymorphism?


What does your textbook say it is?

-Mike
May 18 '06 #10
voidtwerp wrote:
Polymorphism is being able to plug more than one kind of electrical
appliance into a wall socket.
Socks


I mean - heh - thats more like the kinda response i was expecting -
dang google groups


You can go a long way with house wiring as a metaphor for OO design.

Polymorphism we just covered.

Information hiding is pretty easy as well. The wires that bring the
power
to the socket are hidden. So are details like breaker switches, the
step down transformer from the area grid, the bigger transformers
from the regional grid, or what power station exactly produced the
power. Yet you can still plug in your appliances and have them work.
And you can't do gnarly things like following back the wire from the
socket and soldering a lamp to the middle of the wire, or patching
around the breaker. At least, not without a lot of work.

Encapsulation is not so easy. It's not easy to pick up a wall socket
and take it someplace else. So it's tough to draw the boundary
that "the wall socket and it's stuff" fits inside. You can *sort of*
get it from an extension cord.

Abstract type is there but it's quite limited. There are not very many
types of wall socket. 110 and 220, maybe N. American and
European, but that's about as far as it goes. It's hard to get a
new kind of wall socket accepted.

I seem to be forgetting one (or a couple) but I'm forgetting them.
Socks

May 18 '06 #11
All I know it was once a parrot, but now it's one 'L' of a lot less. If
it ever changes back I suggest you ask it.

JB
May 18 '06 #12
miya <nm*******@gmail.com> wrote:
http://en.wikipedia.org/wiki/Polymor...mputer_science)


http://cfaj.freeshell.org/google/

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
May 19 '06 #13
ma*********@hotmail.com <ma*********@hotmail.com> wrote:
polymorphism, means a single handle to some data in compilation time
can be of different types during runtime. Right?


What's a "handle"?

I'd say that you have some clue what polymorphism is, but your choice
of words is extremely poor.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
May 19 '06 #14
It's literal meaning gives you the answer. The word 'poly' means
'many'. 'morphism' means more than one form'. In c++ , 2 kinds of
polymorphisms available. compile time and run time polymorphism.
Function overloading is the example for compile time polymorphism. But
if function binding is postponed till runtime based on what object is
being pointed by base pointer,the right function is invoked.This is an
runtime polymorphism.In c++, it is acieved thru virtual functions.

May 19 '06 #15

Noah Roberts wrote:
miya wrote:
http://en.wikipedia.org/wiki/Polymor...mputer_science)


Wow...when I was in college I had to do my own research. Kids have it
so easy now...


The Internet has great benefits. The information is accessible in
exponential ways now :-)

but they forgot to teach netiquette to the new generation of users :-(

May 19 '06 #16
Noah Roberts wrote:
miya wrote:
http://en.wikipedia.org/wiki/Polymor...mputer_science)


Wow...when I was in college I had to do my own research. Kids have it
so easy now...


Just means we have to expect more out of them! ;-)

--
Mike Smith
May 19 '06 #17
Noah:
Kids have it
so easy now...


Considering using google, information technology, yes. Considering life
in general, I think their world is harder and crueler then a generation
ago.

May 22 '06 #18

ma*********@hotmail.com wrote:
Noah:
Kids have it
so easy now...


Considering using google, information technology, yes. Considering life
in general, I think their world is harder and crueler then a generation
ago.


harder? i don't think so

we face a new generation of wimps

May 22 '06 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: Mike Meng | last post by:
hi all, I'm a newbie Python programmer with a C++ brain inside. I have a lightweight framework in which I design a base class and expect user to extend. In other part of the framework, I heavily...
18
by: Ken | last post by:
Hi. Can anyone refer me to any articles about the compatibility between c++ polymorphism and real-time programming? I'm currently on a real-time c++ project, and we're having a discussion...
10
by: Danny Ni | last post by:
Hi, I was asked a question in a recent interview, where in ASP.Net is polymorphism used? I got differrent answers from different people, One said ToString() method because it is working for...
35
by: JKop | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en- us/vccore98/HTML/_core_using_strict_type_checking.asp Pay particular attention to: The types WPARAM, LPARAM, LRESULT, and void *...
19
by: G.Ashok | last post by:
Hi All, What is your weightage of the 3 characteristics of Object-Oriented Programming i.e. Inheritance, Encapsulation and Polymorphism. for a total of 100% Please quote your values and let's...
6
by: John Salerno | last post by:
I understand how they work (basically), but I think maybe the examples I'm reading are too elementary to really show their value. Here's one from Programming C#: #region Using directives ...
18
by: Seigfried | last post by:
I have to write a paper about object oriented programming and I'm doing some reading to make sure I understand it. In a book I'm reading, however, polymorphism is defined as: "the ability of two...
2
by: sarathy | last post by:
Hi all, I need a small clarification reg. Templates and Polymorphism. I believe templates is really a good feature, which can be used to implement generic functions and classes. But i doubt...
10
by: vb.here | last post by:
Hi all, I am new to C++ and was just reading about polymorphism. I tried to write a very simple program. Then a curious thought came into my mind. And instead of using pointer in polymorphism, i...
123
by: plenty900 | last post by:
I was looking over someone's C++ code today and despite having written perfectly readable C++ code myself, the stuff I was looking at was worse than legalese. The people who are guiding the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.