Difference between ienumerable and list in c#?

Total Post:83

Points:415

C#
 1834  View(s)
Ratings:
Rate this:
  1. Difference between ienumerable and list in c#?

    The difference is that IEnumerable<string> is merely a sequence of string but a List<string> is indexable by an int index, can be added to and removed from and have items inserted at a particular index.

    A List<string> is a specific random-access variable-size collection.

    A List<string> is a concrete implementation of IEnumerable<string>. 

    An IEnumerable<string> is general sequence of string that can be iterated but doesn't allow random access.

Answer