The ArrayList method trimToSize has the following API:
public void trimToSize( )
It trims the capacity of this ArrayList instance to be the list's current size.
ArrayList
numbers.add( 32 );
numbers.add( 17 );
numbers.add( 6 );
Use trimToSize to trim the capacity of numbers to its current size:
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q73: Code a method that returns an int
Q74: Here is the code for selection sort
Q75: Consider the following two-dimensional array:
String [ ][
Q76: The variable cities is an ArrayList of
Q77: The variable numbers is a two-dimensional array
Q79: The ArrayList method indexOf has the following
Q80: Class Reply inherits from class Post. Write
Q81: Class Rectangle inherits from class Shape and
Q82: Here is interface I.
public interface I
{
public abstract
Q83: I is an interface, A is an
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents