Provide code that shrinks an array when the percentage of array cells actually in use falls below the constant SHRINK_THRESHOLD. Use the code for expanding an array from Section 3.2.2 as a model. Assume the name of the array is array and the new array will have length SHRINK_THRESHOLD.
What will be an ideal response?
```
Object[]temp = new Object[SHRINK_THRESHOLD];
System.arraycopy( temp, 0, array, 0, numElements );
array = temp;
```
Computer Science & Information Technology
You might also like to view...
Breadcrumb navigation in SharePoint enables you to easily keep track of the current page location within the site
Indicate whether the statement is true or false
Computer Science & Information Technology
A preview of an open window without having to click away from the window that you are currently working on is known as Aero Flip
Indicate whether the statement is true or false
Computer Science & Information Technology