Polymorphism:
"Generally, the ability to appear in many forms. In object-oriented programming, polymorphism refers to a programming language's ability to process objects differently depending on their data type or class. More specifically, it is the ability to redefine methods for derived classes."
o1 = CREATEOBJECT( "Duck" )
o2 = CREATEOBJECT( "Pig" )
o1.Speak()
o2.Speak()
DEFINE CLASS Homer AS Custom
PROC Speak
= MESSAGEBOX( "DOH!" )
ENDDEFINE
DEFINE CLASS Duck AS Homer
PROC Speak
= MESSAGEBOX( "Quack!" )
ENDDEFINE
DEFINE CLASS Pig AS Homer
PROC Speak
= MESSAGEBOX( "Oink!" )
ENDDEFINE