Sets the number of elements in the array to newLength. If newLength
is greater than length, the new elements are added to the end of the
array and initialized with false.
Complexity:
Guaranteed O(abs(length - newLength)) if capacity >= newLength.
If capacity < newLength the worst case is O(newLength).
Sets the number of elements in the array to newLength. If newLength is greater than length, the new elements are added to the end of the array and initialized with false.
Complexity: Guaranteed O(abs(length - newLength)) if capacity >= newLength. If capacity < newLength the worst case is O(newLength).
Postcondition: length == newLength