|
|
|
|
|
by lazulicurio
2606 days ago
|
|
Sure, good interface design can ease things, but it doesn't really solve the problem I'm talking about. In Java, List<Foo> and List<Bar> are the same interface. In C#, IList<Foo> and IList<Bar> are different interfaces that just happen to have similar properties/methods. This means, in Java you can do Object obj = ...
List<?> lst = (List<?>) obj
Object item = lst.get(3)
Whereas, in C#, to do something similar, you have to dynamically compile at runtime a specialization of a generic delegate. |
|
https://dotnetfiddle.net/jcjchk