2 ms·
T keeps its type info statically. So if you put a Set in, you can get a Set out. Casting to Collection loses the static type info, so you couldn't write foo(b
by mrkeen 4y ago
T keeps its type info statically. So if you put a Set in, you can get a Set out.
Casting to Collection loses the static type info, so you couldn't write foo(bar(set)) if bar returned a Collection but foo accepted a Set.