Here you can find the source of copyOf(char[] array)
public static char[] copyOf(char[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static char[] copyOf(char[] array) { int len = array.length; char[] copy = new char[len]; System.arraycopy(array, 0, copy, 0, len); return copy; }/*from w w w . j a va 2 s. com*/ public static int[] copyOf(int[] array) { int len = array.length; int[] copy = new int[len]; System.arraycopy(array, 0, copy, 0, len); return copy; } public static double[] copyOf(double[] array) { int len = array.length; double[] copy = new double[len]; System.arraycopy(array, 0, copy, 0, len); return copy; } }