Java
ArrayList ensureCapacity() Method in Java
ArrayList ensureCapacity() is used to increase the capacity of the list. A call to this method makes sure that ArrayList can hold at least the number of elements specified by the minimum capacity argument. Before adding a large number of elements to List you can call this method to avoid Read more…