I am reading about generic methods from OracleDocGenericMethod. I am pretty confused about the comparison when it says when to use wild-card and when to use generic methods.
One other difference which is not listed here.
static void fromArrayToCollection(T[] a, Collection c) {
for (T o : a) {
c.add(o); // correct
}
}
But the following will result in compile time error.
static void fromArrayToCollection(T[] a, Collection> c) {
for (T o : a) {
c.add(o); // compile time error
}
}