List<> Capacity returns more items than added

前端 未结 5 1622
北海茫月
北海茫月 2020-12-06 16:58

There are several properties on List that seem to be related to number of items in the list - Capacity, Count (which is prese

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-06 17:55

    The Capacity of the list represents how much memory the list currently has set aside for the current objects and objects to be added to it. The Count of the list is how many items have actually been added to the list.

提交回复
热议问题