ArrayList.trimToSize()

ArrayList.trimToSize() to minimize storage space of an ArrayList.

Examples with output

add()
ArrayList<Integer> marks = new ArrayList<Integer>(50);
marks.add(54);
marks.add(55);
marks.add(56);
marks.add(57);
marks.add(58);
marks.add(59);

marks.trimToSize(); 
System.out.println(marks);//[54, 55, 56, 57, 58, 59]
ArrayList Tutorials


Java


plus2net.com






We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer