Here you can find the source of removeIndex(T[] array, int index)
public static <T> T[] removeIndex(T[] array, int index)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**//www .ja va 2 s . c o m * Returns a copy of the given array, with the element at the given index removed. * <p> * This version moves the last array element to the removed element's position. */ public static <T> T[] removeIndex(T[] array, int index) { return removeIndex(array, index, false); } /** * Returns a copy of the given array, with the element at the given index removed. */ public static <T> T[] removeIndex(T[] array, int index, boolean keepOrder) { if (index != array.length - 1) { if (keepOrder) { System.arraycopy(array, index + 1, array, index, array.length - 2 - index); } else { array[index] = array[array.length - 1]; } } return Arrays.copyOf(array, array.length - 1); } }