| 构造器和说明 |
|---|
ArrayUtils() |
public static int[] add(int[] array,
int element)
Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned
whose component type is the same as the element.
ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
array - the array to copy and add the element to, may be nullelement - the object to add at the last index of the new arrayCopyright © 2020–2021. All rights reserved.