列表默认容量 [英] Default Capacity of List
本文介绍了列表默认容量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是列表的默认容量?
What is the default capacity of a List?
推荐答案
为什么你不试一试呢?
Console.WriteLine("Default capacity of a List: " + new List<int>().Capacity);
这个答案将工作在.NET中有列出所有版本。在我的版本,它正好是0。
This answer will work on all versions of .NET that have List. On my version, it happens to be 0.
这篇关于列表默认容量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文