1

What is ploymorphism??? Im new to oop, and wanna learn more abt it. Preferably in examples from pascal or cpp.

Comments
  • 1
    In that case, a search engine is your friend โ˜บ
    http://webopedia.com/TERM/P/...
  • 0
    @harambae so... Its function overloading?
  • 0
    @harambae oh well. I think, i know what to read about ;}
  • 1
    @linux4fun Polymorphism is where one thing can be used as if it was another.
    The example above that @harmabae did with the operator overloading is called Ad-hoc polymorphism (it can also be done with function overloading).

    There are 2 other types of polymorphism: paramteric and subtyping.

    Parametric polymorphism is basically allowing a function/class/type to be generalised. In C++ you can use templates (meta-programming) to write a datastructure, for example, for any type <T>. Meaning that this DS can hold int, double, string, etc... Holds well in the "write once for many uses" philosophy.
    In Java it's called 'Generics' instead of Templates.

    Subtyping polymorphism allows a function that uses a datatype T to use an object that is a subtype of T.
  • 0
  • 8
    @Letmecode Good thing too. :) He would get 20 answers all telling him to use jquery and then his question would get closed as too broad or some other bs like that by some bored mod on an ego trip.
  • 1
    @ElForritari 1+1=2 and 1+1=11
  • 3
    @Letmecode well, if sb needs help of community, asking for it is not forbidden
    And here answers come faster
  • 0
    @OrestH and thats why I dont get the jokes about "coding without so" especially while compilerbuilding every question of mine was turned down :(
  • 1
    They should give the asker +20 rep if your question wasn't downvoted in the first 30 min.
  • 1
    @lucas22 lel... Actually, because of my assembly learning, now im ip banned on so :(
  • 2
    Also, @linuxer4fun this is a duplicate and too broad question, pls read the guidelines before posting. - jk
  • 1
    @lucas22 you monster๐Ÿ‘พ ๐Ÿ‘พ๐Ÿ‘พ๐Ÿ‘พ๐Ÿ‘พ๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚
Add Comment