News for hackers. Stuff that matters.
Re:A categorized list of all Java and JVM features since JDK... by culturedsystems on Thursday April 01, 2021 @08:39PM (#26668007)
You might want to have something like `String concatenate(List<String> strings)` and `List<T> concatenate(List<List<T>> lists)`.

Java won't let you do this because types are erased at compile time, and Java doesn't know exactly what function it's going to call until run time (in order to allow dynamically loading classes). Haskell does allow something similar to this kind of overloading, because Haskell determines what function is going to be called at compile time, before type erasure happens.

There are no comments on this comment yet.