-
arraycopy () specifies the copy length and starting position
System.arraycopy (dataType [] srcArray, int srcIndex, int destArray, int destIndex, int length) The
target array must exist -
clone ()
array_name.clone () The
return value is object, so it is necessary to perform type conversion -
copyOf () specifies the length
Arrays.copyOf (dataType [] srcArray, int length); the
default starts from 0, and length is the length of the new array -
copyOfRange specifies the starting and ending points
Arrays.copyOfRange (dataType [] srcArray, int startIndex, int endIndex)
Except that the first one is a replacement, the rest is reconstructed if the target array exists