Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@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. -
@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.
-
OrestH7488y@Letmecode well, if sb needs help of community, asking for it is not forbidden
And here answers come faster -
@OrestH and thats why I dont get the jokes about "coding without so" especially while compilerbuilding every question of mine was turned down :(
-
They should give the asker +20 rep if your question wasn't downvoted in the first 30 min.
-
@lucas22 lel... Actually, because of my assembly learning, now im ip banned on so :(
-
Also, @linuxer4fun this is a duplicate and too broad question, pls read the guidelines before posting. - jk
Related Rants
What is ploymorphism??? Im new to oop, and wanna learn more abt it. Preferably in examples from pascal or cpp.
undefined
i have no clue
help