Java Array Range Copy copyOf(char[] array)

Here you can find the source of copyOf(char[] array)

Description

copy Of

License

Open Source License

Declaration

public static char[] copyOf(char[] array) 

Method Source Code

//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;
    }
}

Related

  1. copyOf(byte[] original, int newLength)
  2. copyOf(byte[] original, int newLength)
  3. copyOf(byte[] original, int newLength)
  4. copyOf(byte[] source, int newLength)
  5. copyOf(byte[] src, int length)
  6. copyOf(char[] source)
  7. copyOf(double[] array, int length)
  8. copyOf(double[] v, int newlength)
  9. copyOf(final byte[] bytes)