Java Array Merge merge(E[] a1, E[] a2)

Here you can find the source of merge(E[] a1, E[] a2)

Description

merge

License

LGPL

Declaration

public static <E> List<E> merge(E[] a1, E[] a2) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static <E> List<E> merge(E[] a1, E[] a2) {
        List<E> list = new ArrayList<E>();
        for (int i = 0; i < a1.length; i++) {
            list.add(a1[i]);// w w w  . j a va 2s.  c  o  m
        }
        for (int i = 0; i < a2.length; i++) {
            list.add(a2[i]);
        }
        return list;
    }
}

Related

  1. merge(byte[] src1, byte[] src2)
  2. merge(byte[]... arrays)
  3. merge(byte[]... bytes)
  4. merge(double[] a, int[] b, int p, int q, int r)
  5. merge(double[]... args)
  6. merge(E[] arrayA, E[] arrayB)
  7. merge(final byte[] b1, final byte[] b2)
  8. merge(final byte[]... data)
  9. merge(final String[] array1, final String[] array2)