Java Array Concatenate concatArrays(double[] d1, double[] d2)

Here you can find the source of concatArrays(double[] d1, double[] d2)

Description

concat Arrays

License

Open Source License

Declaration

public static double[] concatArrays(double[] d1, double[] d2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static double[] concatArrays(double[] d1, double[] d2) {
        double[] result = new double[d1.length + d2.length];
        for (int i = 0; i < d1.length; i++)
            result[i] = d1[i];//from   w w w.j  a v  a2 s . co  m
        for (int i = 0; i < d2.length; i++)
            result[i + d1.length] = d2[i];
        return result;
    }

    public static String[] concatArrays(String[] o1, String[] o2) {
        String[] result = new String[o1.length + o2.length];
        for (int i = 0; i < o1.length; i++)
            result[i] = o1[i];
        for (int i = 0; i < o2.length; i++)
            result[i + o1.length] = o2[i];
        return result;
    }
}

Related

  1. concatArrays(byte[] a, byte[] b)
  2. concatArrays(byte[]... arrays)
  3. concatArrays(byte[]... arrays)
  4. concatArrays(byte[]... byaArrays)
  5. concatArrays(byte[][] arrays)
  6. concatArrays(final byte[] arr1, final byte[] arr2)
  7. concatArrays(final char[] first, final char[]... rest)
  8. concatArrays(Object[] ar1, Object[] ar2)
  9. concatArrays(short[] arr1, short[] arr2)