Correlating Java features with Wikipedia's definition of Polymorphism -
wikipedia states there 3 (major) types of polymorphism. correlating definition limited understanding of java polymorphism, mapping came -
- adhoc polymorphism - java function overloading (dynamic dispatch).
- parametric polymorphism - java generics.
- subtyping - java function overriding (static dispatch).
is correct?
references - 1. https://en.wikipedia.org/wiki/polymorphism_%28computer_science%29 2. polymorphism - define in 2 sentences
- ad-hoc polymorphism map method overloading (where method known @ compile time)
is correct
subtyping map to overriding (dynamic dispatch)
Comments
Post a Comment