first, the IList generic interface is a descendant of the ICollection generic interface and is the base interface for all generic lists.
but it is only the interface of all generic types, and there are not too many methods can be convenient and practical, if only as a set of data bearer, it is true that,ilist<t> can be competent.
However, more often, we want to process the collection data, filter the data, or sort it. At this time ilist<t> will be helpless.
1, when you only want to use the interface method,ilis<> this way is better. He does not acquire other methods and fields that implement this interface, effectively saving space.
2, IList <> is an interface, defines a number of operating methods these methods to you to achieve
List <> is a generic class that has implemented the IList <> defined methods
IList <Class1> IList11 =new List <Class1> ();
list <Class1> List11 =new list <Class1> ();
these two lines of code, from the operational point of view, are actually creating an instance of a List<class1> object, that is, their operation is not different.
only the return value variable type used to hold this operation is different.
So, we can understand that these two lines of code are different in purpose.
list <Class1> List11 =new list <Class1> ();
is to create a list<class1>, and you need to use the list<t> function to do the work.
and
IList <Class1> IList11 =new List <Class1> ();
just want to create an instance of an object based on interface ilist<class1>, but this interface is implemented by list<t>. So it just wants to use the functionality specified in the Ilist<t> interface.
PS: Reproduced in Baidu know only for my study and use
Talk about the difference between list and IList in C # (reprint)