Generic method to copy value from one array to another array - Java Collection Framework

Java examples for Collection Framework:Array Copy

Description

Generic method to copy value from one array to another array

Demo Code


//package com.java2s;

public class Main {
    public static <T> void copy(T[] dst, T[] src, int start, int end) {
        for (int i = start; i < end; i++)
            dst[i] = src[i];// ww w.  j  a  va  2  s.  c  om
    }
}

Related Tutorials