C#什么时候应该使用列表,当我应该使用ArrayList? [英] c# When should I use List and when should I use arraylist?

查看:185
本文介绍了C#什么时候应该使用列表,当我应该使用ArrayList?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所说,当我应该使用列表时,我应该使用的ArrayList

As the title says when should I use List and when should I use ArrayList?

感谢

推荐答案

主要时间用的ArrayList 是.NET 1.1

The main time to use ArrayList is in .NET 1.1

除此之外,列表< T> 一路(您当地的 T )...

Other than that, List<T> all the way (for your local T)...

对于那些(罕见)情况下,你不知道类型的前期(并且不能使用泛型),甚至列表&LT;对象&gt; 更有助于比的ArrayList (IMO)。

For those (rare) cases where you don't know the type up-front (and can't use generics), even List<object> is more helpful than ArrayList (IMO).

这篇关于C#什么时候应该使用列表,当我应该使用ArrayList?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆