What is the difference between Collection and List?

  • Thread starter Thread starter Leon_Amirreza
  • Start date Start date
L

Leon_Amirreza

What is the difference between Collection and List?
When shoud I use Collections and when to use Lists?
 
Leon_Amirreza said:
What is the difference between Collection and List?
When shoud I use Collections and when to use Lists?

Use Collection<T> for overriding if you need your own custom list. Use
List<T> otherwise.

Additionally, in public interfaces, don't expose concrete types, use
IList<T>, ICollection<T> or IEnumerable<T>, depending on what you want to
make available to clients.
 
Back
Top