deep Copy Int Matrix - Java java.lang

Java examples for java.lang:Math Matrix

Description

deep Copy Int Matrix

Demo Code


//package com.java2s;

public class Main {
    public static Integer[][] deepCopyIntMatrix(Integer[][] input) {
        if (input == null)
            return null;
        Integer[][] result = new Integer[input.length][];
        for (int r = 0; r < input.length; r++) {
            result[r] = input[r].clone();
        }//from   w  ww . ja  v a  2s  . c o  m
        return result;
    }
}

Related Tutorials