trimToSize() Object Method : Java.util.ArrayList

   

Declaration :

Explanation :

Purpose trimToSize() method trims the capacity of this ArrayList equal to list's current size
Parameters NA
Return Value NA
Exception NA

Example

The following example shows the usage of java.util.Arraylist.trimToSize() method.

Output :