clone Array - Java Collection Framework

Java examples for Collection Framework:Array Clone

Description

clone Array

Demo Code


//package com.java2s;

public class Main {
    public static Integer[] cloneArray(Integer[] arr) {
        Integer[] newArr = new Integer[arr.length];
        System.arraycopy(arr, 0, newArr, 0, arr.length);
        return newArr;
    }/*from ww  w. j  a va 2  s.  co  m*/
}

Related Tutorials