Mega Code Archive

 
Categories / Java / Collections Data Structure
 

Copying Elements from One Array to Another

public class Main {   public static void main(String[] argv) throws Exception {     int[] src = { 1, 2, 3 };     int[] dst = { 1, 1, 1 };     System.arraycopy(src, 0, dst, 0, Math.min(src.length, dst.length));   } }