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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…