Tobias Bachert wrote:Type-erasure is happening, your makeArray method has compiled the type (Object[])Object[], but the generic types are still present during compile-time -> you create and pass a String array to the method (and thus receive a String array).
Your code is compiled similar to
Thank you very much.
So the compiler translates the argument list to the equivalent array creation expression before type erasure.
This prints Comparable, even though I have Strings.
So it is the inferred type that counts, not the actual type.