ArrayList和List< object>之间的区别? [英] Difference between ArrayList and List<object> ?

查看:87
本文介绍了ArrayList和List< object>之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


ArrayList和List< object之间有什么区别吗?哪个

我应该用哪个?


谢谢。

Hello,

Is there any difference between ArrayList and List<object? Which
one should I use ?

Thanks.

推荐答案

2006年10月20日01:31:11 -0700,Murat Ozgur < mu ******** @ gmail.com>

写道:
On 20 Oct 2006 01:31:11 -0700, "Murat Ozgur" <mu********@gmail.com>
wrote:

ArrayList和List<之间有什么区别吗? ;宾语?我应该使用哪一个?
Is there any difference between ArrayList and List<object? Which
one should I use ?



我认为List<对象应该更好,因为它使用泛型;所以

它比ArrayList更安全(你可以放置从基础对象类派生的所有内容)。

I think List< object should be better, because it uses generics; so
it is type safer than ArrayList (in which you can put everything
derived from base object class).


真的没什么区别,我可能会使用List< ObjectBause然后

对其他人来说很清楚你打算存储一份清单

对象(或各种派生类型),而不是一些总是需要明确投射的其他特定类型的列表。


-

Chris Fulstow

MCP,MCTS
http://chrisfulstow.blogspot.com/

Murat Ozgur写道:
Not much difference really, I''d probably use List<Objectbecause then
it''s clear to other people that your intention was to store a list of
Objects (or various derivative types), rather than a list of some other
specific type that would always need explicitly casting.

--
Chris Fulstow
MCP, MCTS
http://chrisfulstow.blogspot.com/
Murat Ozgur wrote:

您好,


ArrayList和List< object之间有什么区别吗?哪个

我应该使用哪一个?


谢谢。
Hello,

Is there any difference between ArrayList and List<object? Which
one should I use ?

Thanks.


ArrayList和List< object之间有什么区别吗?哪个
Is there any difference between ArrayList and List<object? Which

我应该使用哪一个?
one should I use ?



我会选择使用List< object,因为List< object>

上的改进API无法使用ArrayList。


最好的问候,

Dustin Campbell

Developer Express Inc.

I''d choose to use List<objectbecause of the improved APIs on List<object>
that aren''t available on ArrayList.

Best Regards,
Dustin Campbell
Developer Express Inc.

这篇关于ArrayList和List&lt; object&gt;之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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