.NET:ArrayList的VS名单 [英] .NET: ArrayList vs List
问题描述
在VB.NET ArrayList和列表之间的区别是什么
What is the difference between ArrayList and List in VB.NET
推荐答案
的ArrayList基本上是德precated因为它们是无类型 - 你需要使用注塑与他们 - 他们是慢和更小的空间有效的价值类型,因为他们需要的物品进行装箱。
ArrayLists are essentially deprecated as they're untyped - you need to use casts with them - and they're slower and less space efficient for value types because they require the items to be boxed.
泛型列表进行了介绍与.net 2.0,而且要走的路。通常,一个列表比数组好,有几个缺点。
Generic lists were introduced with .Net 2.0 and are the way to go. Often a List is better than an array, with few downsides.
由于这些藏品的.NET基础类库的一部分,这个建议也适用于C#和任何.NET语言,它支持泛型 - 它不是具体到VB.NET
As these collections are part of the .Net Base Class Library, this advice also applies to C# and to any .Net language which supports generics - it's not specific to VB.NET.
这篇关于.NET:ArrayList的VS名单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!