Java Array Copy Methods
Object.clone(): Object class provides clone() and as we know, an array in java is also an Object, we can use this method to achieve full array copy. Note: This method will not suit you if you want partial copy of the array.
Arrays.copyOfRange(): If only few elements of an array are to be copied, where starting index is not 0, you may use this method to copy partial array.
System.arraycopy(): System class arraycopy() is the best way to do partial copy of an array. It provides you an easy way to specify the total number of elements to copy and the source and destination array index positions. For example
System.arraycopy(source, 3, destination, 2, 8)
will copy 8 elements from source to destination, beginning from 3rd index of source to 2nd index of destination
Arrays.copyOf(): If you want to copy first few elements of an array or full copy of array, you can use this method. It is used due to its simplcity