Re:How generics were added to .NET
by ygra on Tuesday March 06, 2018 @02:57AM
(#16527551)
You'd have to call the Java variant via reflection to show the difference at runtime, as the compiler would already enforce that myList.add(new Object()) won't compile. The point stands, though.
[ Parent
| on HN ]
Reflection is not required. I actually had the code, somehow got deleted
List myList = new ArrayList<String>(); myList.add(new Object());
this would compile.