What is the difference between IList and List?
  • A List is a concrete class that represents a collection of objects or values of the defined type.
  • It can be used as a dynamic array where the individual elements can be accessed over an index and the collection can be iterated as a whole.
  • An IList is an interface, that is implemented by the List class.
  • An IList is used when a component is developed to be exposed to the outside that takes in a collection of objects or returns a collection of objects, as a design best practice.
  • Both the IList and List implement the IEnumerable interface.

C# Concepts •  Added 29 days ago

Join the Newsletter

Subscribe to get our latest content by email.
    We won't send you spam. Unsubscribe at any time.
    We use cookies to provide you with a great user experience, analyze traffic and serve targeted promotions.   Learn More   Accept