| first, the ilist generic interface is the child of the icollection generic interface and is the base interface of all generic lists. it is only an interface of all generic types, and there are not many methods that can be used conveniently. If it is only used as the bearer body of the set data, it is true, ilist is competent. however, in more cases, we need to process the set data and filter or sort the data from it. At this time, ilist cannot help. 1. When you only want to use the interface method, ilis <> This method is better. it does not obtain other methods and fields of the class implementing this interface, effectively saving space. 2. ilist <> is an interface that defines some operation methods. These methods must be implemented by yourself. List <> is a generic class, it has implemented the ilist <> defined methods ilist ilist11 = new list (); List list11 = new list (); Code , in fact, they all create a list object instance, that is, their operations are no different. the variable type used to save the operation is different. so we can understand that the two lines of code have different purposes. List list11 = new list (); you want to create a list and use the list function,. and ilist ilist11 = new list (); you just want to create an instance of an object based on the Interface ilist , this interface is implemented by list . Therefore, you only want to use the functions specified by the ilist interface. |