c# 3.5 class List<int> class initialisation
Posted
by josephj1989
on Stack Overflow
See other posts from Stack Overflow
or by josephj1989
Published on 2010-05-28T08:28:30Z
Indexed on
2010/05/28
8:31 UTC
Read the original article
Hit count: 195
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
© Stack Overflow or respective owner