This post will discuss different ways to make a copy of an array in Java.

1. Using System.arraycopy() method

Download  Run Code

2. Using Arrays.copyOf() method

Download  Run Code

3. Using Arrays.copyOfRange() method

Download  Run Code

4. Using Object.clone() method

Download  Run Code

5. Using Apache Commons Lang – ArrayUtils.clone() method

Download Code

That’s all about copying an array in Java.