Here you can find the source of copy(int[][] input)
public static int[][] copy(int[][] input)
//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; } }