Saturday, 18 May 2013

Difference between IEnumerable, ICollection and IList Intrefaces in C#

Difference between IEnumerable, ICollection and IList Intrefaces in C#

Below article demonstrates the difference between IEnumerable, ICollection and IList Intrefaces. IEnumerable interface is the core interface and is implemented by ICollection and IList. Lets have a look.


Its a core interface which is used to iterate over collection of specified type. Mainly implements two methods:

MoveNext: which is of boolean type which tells whether there are more records to move on or not.

GetCurrent: which returns the current record from the collection.
ICollection: Implements IEnumerable

It is an interface used to manipulate generic collections, as it implements IEnumerable interface so its obvious that this will also implements methods MoveNext and GetCurrent, so with this interface you can iterate through collection. Apart from this its also having its own methods like:

Add: Adds record at the end of collection
Remove: Removes specified item from collection
Contains: Its a boolean type method which tells whether collection contains the specified item or not.


Interface which is collection of non-generic type objects and can be accessed by index. It is the interface which implements two interfaces ICollection and IEnumerable. So its obvious that this will Implements the methods of the both the interfaces. Its own methods are:

Insert: Insert the given item at specified Index.
RemoveAt: Removes the item from specified Index.
IndexOf: Retrieves the item from specified Index.


  1. Simple and Direct. Excellent Article !!!

  2. Very simple .. thanks .

  3. Very useful ... Thankyou

  4. Nice and... Best article,
    Thank U

  5. vice nice. to the point and easy to understand. thanks

  6. Coach Outlet Store Online Michael Kors Outlet Coach Factory Outlet Toms Shoes Cheap Jerseys Michael Kors Coach Outlet Coach Factory Outlet Coach Outlet Coach Handbags Giuseppe Zanotti Coach Factory Outlet Online Coach Outet Store Online Coach Factory Outlet Michael Kors Outlet Online Celine Outlet Michael Kors Michael Kors Store Tomss Hoes Prada Outlet Fitflop Footwear Celine Bags Fitflops Flipflops Fitflops Giuseppe Zanotti Designer Fitflops Giuseppe Zanotti Sneakersmen Fitflops

  7. Want to learn C# from basics & in most professional Code development style. I'll have you writing real working applications in no time flat-before you reach the end of course.
    Hire C# Teacher.