2 ms·
Collections are allowed to grow larger than size() can handle. The documentation for size() says: > If this collection contains more than Integer.MAX_VALUE ele
by _delirium 14y ago
Collections are allowed to grow larger than size() can handle. The documentation for size() says:
> If this collection contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
- thrownaway2424 14y agoI see, thanks for pointing it out. I always considered it a fundamental limitation of collections, because all or almost all of them are array-backed, and array indices in java are int, therefore the collections are generally limited to 2^31 items.
- omaranto 14y agoDoes the term "array-backed" include the possibility of using an array of arrays? That would get you up to about 2^62...