How much data can be added in java.util.List in Java at the maximum?
Is there any default size of an ArrayList?
It depends on the List
implementation. Since you index arrays with int
s, 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.