Java Array Range Copy copyOfArray(int[] a)

Here you can find the source of copyOfArray(int[] a)

Description

copy Of Array

License

Open Source License

Declaration

private static int[] copyOfArray(int[] a) 

Method Source Code

//package com.java2s;
/*//www.j a  v  a2 s  . co m
 * Copyright 2001-2008 Aqris Software AS. All rights reserved.
 * 
 * This program is dual-licensed under both the Common Development
 * and Distribution License ("CDDL") and the GNU General Public
 * License ("GPL"). You may elect to use one or the other of these
 * licenses.
 */

public class Main {
    private static int[] copyOfArray(int[] a) {
        int[] result = new int[a.length];
        for (int i = 0; i < result.length; i++) {
            result[i] = a[i];
        }
        return result;
    }
}

Related

  1. copyOf(Object[] array, int newLength)
  2. copyOf(Object[] values, int nlen)
  3. copyOf(String[] data, int newLength)
  4. copyOf(String[] original, int newLength)
  5. copyOf(T[] oriArray, int newArraySize, int startOffset)
  6. copyOfRange(byte[] bytes, int offset, int len)
  7. copyOfRange(byte[] original, int from, int to)
  8. copyOfRange(byte[] original, int from, int to)
  9. copyOfRange(byte[] original, int from, int to)