Java Array Concatenate concatenate(T[] first, T[] second)

Here you can find the source of concatenate(T[] first, T[] second)

Description

Concatenates two arrays and returns the result

License

Open Source License

Declaration

public static <T> T[] concatenate(T[] first, T[] second) 

Method Source Code


//package com.java2s;

import java.util.*;

public class Main {
    /**/*from w  w w . j  ava 2s  . co m*/
     * Concatenates two arrays and returns the result
     */
    public static <T> T[] concatenate(T[] first, T[] second) {
        T[] result = Arrays.copyOf(first, first.length + second.length);
        System.arraycopy(second, 0, result, first.length, second.length);
        return result;
    }
}

Related

  1. concatenate(Object[] array)
  2. concatenate(Object[] array)
  3. concatenate(Object[] collection)
  4. concatenate(String[] args)
  5. concatenate(String[] strings, String sep)
  6. concatenate2Arrays(T[] array1, T... array2)
  7. concatenateArray(Object[] srcOne, Object[] srcTwo)
  8. concatenateArrays(T[] first, T[]... rest)
  9. concatenateStrings(Object[] strings, String glueString)