Capacity of ArrayList [duplicate]
Possible Duplicate: How to get the capacity of the ArrayList in Java? How to find the capacity of an ArrayList ? I'm curious, what do you need it for? You should know that the capacity is not (as it may sound) an upper limit of how much you can put into the ArrayList . It's a value representing how much data you can put into the list, without forcing it to reallocate it internal array. Basically, the notion of capacity is only there in order for you to tweak the performance slightly. Anyway, perhaps you already know that, so here comes the actual answer. The interface provided by API for