I wonder why LinkedList
doesn\'t have initialCapacity
.
I know good when to use ArrayList
and when LinkedList
.
LinkedList by nature does not have "capacity", since it does not allocate memory to the items before the items are added to the list. Each item in a LinkedList holds a pointer to the next in the list.
There would be no point in allocating memory to the list beforehand, since LinkedList does not have capacity.