Is there any way to accomplish something like List<object> list = new List<int>() in C#?
- by devoured elysium
That is the question. What I want to accomplish is something similar to the following Java code:
class A { }
class B extends A { }
public class Tests {
public static void main(String [] args) {
ArrayList<? extends A> lists = new ArrayList<B>();
}
}
(in which B extends A means B inherits from A)
Is it possible at…