Please visit DEMANDDRAFT.SHOP for quality of products...

Ad

Search This Blog

Thursday, April 11, 2013

difference between IEnumerable and List in C#



1IEnumerable is an interface
2List is one specific implementation of IEnumerable. List is a class.

3FOR-EACH loop is the only possible way to iterate through a collection of IEnumerable,
4List can be iterated using several ways. Like For loop, Foreachloop.

5IEnumerable doesn't allow random access.
    List allows random access using integral index.

In from of  performance point, IEnumerable is much faster than a List.

No comments:

Post a Comment