I have a basic question on Java ArrayList.
ArrayList
When ArrayList is declared and initialized using the default constructor, memory space for 10 el
Up to JDK 6 the the capacity grow with formula newCapacity = (oldCapacity * 3/2) + 1.
newCapacity = (oldCapacity * 3/2) + 1
In JDK 7 and above the formula changes to newCapacity = oldCapacity + (oldCapacity >> 1).
newCapacity = oldCapacity + (oldCapacity >> 1)
So if initial capacity is 10 then new capacity will be 16 in JDK6 and 15 in above JDK7
10
16 in JDK6
15 in above JDK7