class C {
static <T> void copy (List<? extends T> a, List<? super T> b) {
for (T t : a)
b.add (t);
}
}class C
{
static void copy<T>(List<T> a, List<T> b)
{
foreach (T t in a)
b.Add(t);
}
}
Dabei macht mit das ? extends T Probleme
public static void copy<S, T> (List<S> a, List<T> b)
where S: T
{
foreach (T t in a)
b.Add(t);
}