what is polymorphism?

M

marcwentink

polymorphism, means a single handle to some data in compilation time
can be of different types during runtime. Right?
 
G

Geo

voidtwerp said:
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
 
V

voidtwerp

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
 
P

Puppet_Sock

voidtwerp said:
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
 
N

n2xssvv g02gfr12930

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
 
C

Christopher Benson-Manica

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.
 
K

kavitha_irtt2002

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.
 
D

Diego Martins

Noah said:
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 :-(
 
M

marcwentink

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.
 
D

Diego Martins

Noah:


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top