Deep Copy an Array Using the Arrays. Below, we use the copyOf() method of the Arrays utility class . It accepts the array to copy and its size then returns the array of the same type. We make a new array arr2 using this method and check if changing arr2 changes arr1 or not. The output shows the result.