News for hackers. Stuff that matters.
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.
Re:How generics were added to .NET by tehlike on Tuesday March 06, 2018 @03:00AM (#16527562)
Reflection is not required. I actually had the code, somehow got deleted

List myList = new ArrayList<String>(); myList.add(new Object());

this would compile.

Re:How generics were added to .NET by ygra on Tuesday March 06, 2018 @03:34AM (#16527654)
Ah, I missed the missing generics on the declaration. Sorry.