-
November 16th, 2005, 10:11 AM
#1
Polymorphism
Hello firends
From PHP 5 mysql Bible(Page 373) :
"There should be only one constructor function per class definition. Defining more than one such function is syntactically legal, but pointless, as only the definition that occurs last will be in effect. If you’d like to have different constructors to handle different numbers and types of input arguments, "
What is relationship between "different constructors to handle different numbers and types of
input arguments" and "polymorphism"?
Thanks in advance,
GOOD LUCK!
-
November 17th, 2005, 03:39 PM
#2
Re: Polymorphism
I suppose it would be nice if you would explain exactly what you understand polymorphism to be.
If you mean the ability to call different function dependant on the runtime type of an object, not much, having multiple constructors or indeed regular functions with the same name, but different arguments (Number and/or types) is commenly referred to as overloading.
The biggest problem encountered while trying to design a system that was completely foolproof,
was, that people tended to underestimate the ingenuity of complete fools.
Douglas Adams
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|