Rob Spoor wrote:Campbell is right. Both of your methods have a generic argument T.
One of the method has T and the other T[] as argument/parameter.
Rob Spoor wrote:When you use JenericMethod.<String[]>ship, you use String[] for T, not for T[] - because the generic type is not T[] but T.
I don't think it is possible to declare generic type as
T[], And
JenericMethod.<String>ship calls the overloaded array method while the generic type is
T. The confusing thing for me is that when I use
JenericMethod.<String>ship to call the method, the compiler identifies correctly which method to call based on the argument.
As you can see in the image below, the
IDE also identifies the correct/ my assumption/
method using the argument type.