Java Array Copy copy(int[][] input)

Here you can find the source of copy(int[][] input)

Description

copy

License

Open Source License

Declaration

public static int[][] copy(int[][] input) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static int[][] copy(int[][] input) {
        int[][] target = new int[input.length][];
        for (int i = 0; i < input.length; i++) {
            target[i] = Arrays.copyOf(input[i], input[i].length);
        }//from  w w w . j av a  2s. com
        return target;
    }

    public static int[] copy(int[] input) {
        int[] target = new int[input.length];
        for (int i = 0; i < input.length; i++) {
            target[i] = input[i];
        }
        return target;
    }
}

Related

  1. copy(final boolean[] array)
  2. copy(final byte[] bytes)
  3. copy(final byte[] inBytes)
  4. copy(int[] array)
  5. copy(int[] array)
  6. copy(long[] array)
  7. copy(long[] v)
  8. copy(T[] array)
  9. copy(T[] array)