Java examples for Collection Framework:Array Auto Increment
remove Array Item
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { public final static Integer[] removeArrayItem(Integer[] array, Integer item) {/*w w w. j a v a2s . co m*/ List<Integer> list = new ArrayList<Integer>(); for (Integer arrayItem : array) { if (!arrayItem.equals(item)) list.add(arrayItem); } Integer[] ret = new Integer[list.size()]; list.toArray(ret); return ret; } }