List和Array之间的区别 [英] Difference between List and Array
问题描述
List和Array之间有什么区别在java?或者Array和Vector之间的区别!
What is the difference between List and Array in java? or the difference between Array and Vector!
推荐答案
一般情况下(和Java中)数组是一种通常由顺序组成的数据结构存储一组对象的内存。
In general (and in Java) an array is a data structure generally consisting of sequential memory storing a collection of objects.
列表
是 interface ,这意味着它可能有多个实现。其中一个实现是 ArrayList
,这是一个使用数组作为数据实现 List
接口行为的类结构。
List
is an interface in Java, which means that it may have multiple implementations. One of these implementations is ArrayList
, which is a class that implements the behavior of the List
interface using arrays as the data structure.
还有许多其他类实现了 List
接口。查看它们的一个简单方法是查看Javadoc List
: http://docs.oracle.com/javase/6/docs/api/java/util/List.html
There are a number of other classes that implement the List
interface. One easy way to take a look at them is by viewing the Javadoc for List
: http://docs.oracle.com/javase/6/docs/api/java/util/List.html
在该页面上,您将看到所有已知的实现类,它们都是Java中的所有类型的列表。
On that page, you'll see "all known implementing classes," which are all of the kinds of lists in Java.
这篇关于List和Array之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!