CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Polymorphism

  1. #1
    Join Date
    Aug 2005
    Posts
    98

    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!

  2. #2
    Join Date
    May 2003
    Location
    Denmark
    Posts
    1,315

    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
  •  





Click Here to Expand Forum to Full Width

Featured