Differences
This shows you the differences between two versions of the page.
pp:polymorphism [2017/03/29 11:04] pdmatei created |
pp:polymorphism [2018/04/17 16:06] (current) sergiu |
||
---|---|---|---|
Line 106: | Line 106: | ||
**Question:** What is the actual behaviour of the above code? | **Question:** What is the actual behaviour of the above code? | ||
- | One final note regarding ad-hoc polymorphism is that the function signature **cannot differ only in the returned type**. This holds in both Java, C++ and Scala. To see why this is the case, consider the following definitions: | + | One final note regarding ad-hoc polymorphism is that the function signature **cannot differ only in the returned type**. This holds in both Java, and Cpp and Scala. To see why this is the case, consider the following definitions: |
<code java> | <code java> |