0
Java Array Resize
I'm trying to figure out how to resize an underlying array after removing elements in an ArrayList. So that after removing an element, the number of elements in the array is less than or equal to 25% of the array’s length. The underlying array should be shrunk to half its current length.
1 Odpowiedź
+ 1
Try
int arr[] = Arrays.copyOfRange(source, start, count) ;
Edit : Array and ArrayList are different..