I am new to C#.I wish to know the differences of using Collections. I suspect ,the following question may be asked before(If so kindly show me the link).
What is the Difference between
IList<int> intCollection = new List<int>();
and
List<int> intCollection = new List<int>();
- Why should i expose my collection through interface.
- Is it just syntatic sugar for choosing the first approach?
- What would be the disadvantages will i face if i suppose to use the later approach?
- If the corresponsing interface exits,should initialize all collection class indirectly using their corresponding interface?
- Please show me the benefits in example of exposing collection through interface.