Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;
    }
}