Hi,
The following code obviously doesn't work because List<E>
is abstract:
public class MyList {
private List<E> list;
public MyList() {
this.list = new List<E>();
}
}
How can I initialize MyList
class with an empty constructor if I need the list
variable to be a LinkedList
or a ArrayList
depending on my needs?