Java tutorial
//package com.java2s; public class Main { public static Object[] removeElement(Object[] array, Object element) { Object[] newArray = new Object[array.length - 1]; int index = 0; for (Object entry : array) { if (!entry.equals(element)) { newArray[index++] = entry; } } return newArray; } }