c# 3.5 class List<int> class initialisation
- by josephj1989
I can initialize a List like new List{1,2,3,4,5};
However List does not have a constructor which accepts a single parameter.
So I tried to run this through the debugger and it seems to be calling the Add method.
So how does the compiler know which method to invoke to add each individual element.
This may be a silly question but I am a bit confused.
Thanks