DIFFERENCE BETWEEN IENUMERABLE AND LIST IN C#?

Total Post:0

Points:0
C#
 551  View(s)
Ratings:
Rate this:
  1. Post:83

    Points:415
    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

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!