有多少数据的列表可以容纳的最大 [英] How many data a list can hold at the maximum

查看:111
本文介绍了有多少数据的列表可以容纳的最大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

多少数据可以在java.util.List中在最大添加在Java中
是否有任何默认大小的数组列表?

How much data can be added in java.util.List in Java at the maximum Is there any default size an array list?

推荐答案

这取决于列表的实施。自从与 INT 是你索引数组,一个的ArrayList 不能持有超过整数多。 MAX_VALUE 元素。 A 链表不以同样的方式的限制,虽然和可包含的元素的任何量。

It depends on the List implementation. Since you index arrays with ints, an ArrayList can't hold more than Integer.MAX_VALUE elements. A LinkedList isn't limited in the same way, though, and can contain any amount of elements.

这篇关于有多少数据的列表可以容纳的最大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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