nallya

nallya

  • NA
  • 459
  • 472.6k

Doubt Regarding Book "List-EBook"

Dec 6 2012 5:03 AM
Sir,
i have downloaded the book "List-EBook"                                                       http://www.c-sharpcorner.com/ebooks/free/61/programming-list-with-C-Sharp.aspx from and running list sample,i have doubt on 4th page sample u have given that,

We can also limit the size of a list. The following code snippet creates a list where the key type is float and the total number of items it can hold is 3.
List<float> PriceList = new List<float>(3);
The following code snippet adds items to the list.
PriceList.Add(3.25f);
PriceList.Add(2.76f);
PriceList.Add(1.15f);

but i am able to add more list item in this sample although its limit (3) is given.

clear my doubt,
Thanks.

Answers (2)