First time using generics.
I've successfully created an ArrayList of generic objects, and I would like to convert it to a regular array T[]
.
Normally, this is something like
String[] x = (String[])myStrings.toArray(new String[0])
However, in this case, replacing String with T
does not work. i.e.
return (T[]) ret.toArray(T[0]);
Here is complete code for my method, tho not sure it is relevant: https://puu.sh/AzxKD/f525bdbe77.png