I can\'t seem to find a Java List that\'s max length is long\'s max value.
Does such a List exist?
If so, where?
From the List documentation:
int size()Returns the number of elements in this list. If this list contains more than
Integer.MAX_VALUEelements, returnsInteger.MAX_VALUE.
So, even if a specific implementation of List holds Long.MAX_VALUE elements, you wouldn't know, using the standard List interface.
I'm not sure if one exists, but my bet would be on LinkedList, since ArrayList is based on arrays, and those can't hold more than Integer.MAX_VALUE elements.