Java Array Add addArray(int[] a, int[] b)

Here you can find the source of addArray(int[] a, int[] b)

Description

add Array

License

Open Source License

Declaration

private static int[] addArray(int[] a, int[] b) 

Method Source Code

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

public class Main {
    private static int[] addArray(int[] a, int[] b) {
        int[] result = null;

        if (a != null && b != null) {
            result = new int[a.length + b.length];
            System.arraycopy(a, 0, result, 0, a.length);
            System.arraycopy(b, 0, result, a.length, b.length);
        } else {//from   w  ww  .j a  va  2 s.c om
            if (b != null)
                return b;
            if (a != null)
                return a;
        }

        return result;

    }
}

Related

  1. addArray(double[] array1, double[] array2)
  2. addArray(int[] a, int p)
  3. addArray(Object[] Old, Object[] New)
  4. addArray(Object[][] first, Object[][]... more)
  5. addArray(StringBuffer RCode, String name, T[] array, boolean useEquals, boolean isString)
  6. addArrayAll(byte[] array1, byte[] array2)