The tiger list cannot be used as a list of animals, because you can put the turtle on the list of animals, but not on the list of tigers.
In C # 4 and 5, this is legal if you use IEnumerable<T> instead of List<T> , because there is no way to put the turtle in a sequence of animals. Therefore you can say:
List<B> myList = new List<B>(); IEnumerable<A> myUpcastedList = myList;
source share