Java Array Concatenate concat(T[] a, T[] b)

Here you can find the source of concat(T[] a, T[] b)

Description

concat

License

Open Source License

Declaration

public static <T> T[] concat(T[] a, T[] b) 

Method Source Code

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

import java.util.Arrays;

public class Main {
    public static <T> T[] concat(T[] a, T[] b) {
        int al = a.length;
        int bl = b.length;
        T[] c = Arrays.copyOf(a, al + bl);
        for (int i = 0; i < bl; i++) {
            c[al + i] = b[i];//ww w. j a v  a  2 s.c o  m
        }
        return c;
    }
}

Related

  1. concat(String[] array, String separator)
  2. concat(String[] parts)
  3. concat(String[] strs)
  4. concat(String[]... arrays)
  5. concat(T val, T[] vals)
  6. concat(T[] a, T[] b, T[] c, T[] d)
  7. concat(T[] arr0, @SuppressWarnings("unchecked") T[]... more)
  8. concat(T[] array, Collection collection)
  9. concat(T[] array1, T[] array2)