You could use commons lang's ArrayUtils.

array = ArrayUtils.removeElement(array, element)

commons.apache.org library:Javadocs

Answer from Peter Lawrey on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › java › remove-an-element-at-specific-index-from-an-array-in-java
Remove an Element at Specific Index from an Array in Java - GeeksforGeeks
July 11, 2025 - Explanation: This example includes finding the element at the specified index and then removing that element. The rest of the elements are copied into a new array. This would lead to an array of size one less than the original array. We can use Java 8 streams to remove element at specific index from an array, when modifying small or mid-sized arrays.
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-remove-array-elements
Java Remove Array Elements: Methods and Examples | DigitalOcean
Learn to remove elements from arrays in Java. Complete guide covering ArrayList, Apache Commons, and array manipulation techniques with code examples.
🌐
Baeldung
baeldung.com › home › java › java array › removing an element from an array in java
Removing an Element from an Array in Java | Baeldung
June 12, 2024 - Given the array below, let’s remove an element at index 2: A simple way of doing this would be to replace the value stored at index 2 with the value stored at index 3 until we reach the end of the array: Notice that by removing the element ...
🌐
Stack Abuse
stackabuse.com › remove-element-from-an-array-in-java
Remove Element from an Array in Java
December 16, 2021 - The final argument is the number of elements to copy from the source array. The arraycopy is generally used to copy contents from some source array into some destination array. Though, we can also copy an array, or a part of it, into itself. This allows us to shift a part of it to the left like last time: int[] array = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}; int index = 3; To remove the element, we only need to write this one line of code:
🌐
Coderanch
coderanch.com › t › 528600 › java › Remove-element-array-index
Remove an element from array by index (Beginning Java forum at Coderanch)
February 24, 2011 - Hi all , Do we have any method in Java in String or StringUtils to remove an element from a string aray by index. like remove(startindex,endIndex) in C#. I looked over internet and StringUtils too,but i couldnt find any. What would be the simplest method without adding performance -slow-down to my project to do this? Using StringBuffer? I already have lot of Stringbuilder -String conversions in my method. Thanks ... Well, a StringBuffer or StringBuilder doesn't model an array of Strings, so that really isn't a candidate anyway.
🌐
Software Testing Help
softwaretestinghelp.com › home › java › remove/delete an element from an array in java
Remove/Delete An Element From An Array In Java
April 1, 2025 - To remove an element from an array, we first convert the array to an ArrayList and then use the ‘remove’ method of ArrayList to remove the element at a particular index. Once removed, we convert the ArrayList back to the array. The following implementation shows removing the element from an array using ArrayList. import java.util.*; import java.util.stream.*; class Main { public static int[] remove_Element(int[] myArray, int index) { if (myArray == null || index < 0 || index >= myArray.length) { System.out.println("non-existing index"); return myArray; } //array to arrayList List<
Find elsewhere
🌐
How to do in Java
howtodoinjava.com › home › java array › removing items from an array in java
Removing Items from an Array in Java
February 10, 2022 - Learn to remove the array items in Java by the index positions as well as the item values using ArrayUtils, Collections APIs and custom code.
🌐
w3resource
w3resource.com › java-exercises › array › java-array-exercise-7.php
Java - Remove a specific element from an array
May 9, 2025 - System.out.println("Original Array : " + Arrays.toString(my_array)); // Define the index of the element to be removed (second element, index 1, value 14). int removeIndex = 1; // Loop to remove the element at the specified index. for (int i ...
🌐
Stack Overflow
stackoverflow.com › questions › 59348581 › how-can-i-remove-an-element-from-array-in-java
How can i remove an element from array in Java - Stack Overflow
CopyList<String> names = new ArrayList<>(Arrays.asList("Testname", "Charel", "Melissa", "Kelly")); names.remove("Melissa"); System.out.println(names); Output of both is the same as above.
🌐
Netjstech
netjstech.com › 2017 › 07 › how-to-remove-elements-from-array-java.html
How to Remove Elements From an Array Java Program | Tech Tutorials
Here the array removal is done ... enter the element to be removed. Search in the array for the given element. If found shift all the element after that index to the left by one element....
🌐
Java67
java67.com › 2012 › 12 › how-to-remove-element-from-array-in-java-example.html
How to Remove an Element from Array in Java with Example | Java67
Here is a complete code example of how to remove an element from Array in Java. In this example, we have used a primitive array, particularly int array and Apache commons ArrayUtils to remove an integer based on its index. The ArrayUtils also provided several overloaded remove() methods for ...
🌐
Techie Delight
techiedelight.com › home › java › remove an element at a specific index from an array in java
Remove an element at a specific index from an array in Java | Techie Delight
July 7, 2026 - We know that Java arrays are fixed-length, unlike ArrayList, which is dynamic. Therefore, Java doesn’t permit the removal of an element at the specified position in an array.
🌐
W3Schools
w3schools.com › java › ref_arraylist_remove.asp
Java ArrayList remove() Method
Remove an integer from the list by position and by value: import java.util.ArrayList; public class Main { public static void main(String[] args) { ArrayList<Integer> list = new ArrayList<Integer>(); list.add(5); list.add(8); list.add(9); list.add(1); list.remove(Integer.valueOf(1)); // Remove by object list.remove(1); // Remove by index System.out.println(list); } }
🌐
Delft Stack
delftstack.com › home › howto › java › java remove element from array and shift
How to Remove Element From Array and Then Shift Other Elements in Java | Delft Stack
February 2, 2024 - In this code, we create an ArrayList from the array, allowing us to use the remove method to eliminate the element at the specified index. After removing the element, convert the ArrayList back to an array.
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-list-remove-methods-arraylist-remove
How To Use remove() Methods for Java List and ArrayList | DigitalOcean
Learn how to use the remove() method in Java’s List and ArrayList interfaces with examples for removing by index or object.
🌐
GeeksforGeeks
geeksforgeeks.org › java › removing-element-from-the-specified-index-in-java-arraylist
Removing Element from the Specified Index in Java ArrayList - GeeksforGeeks
March 31, 2023 - ... // Java program to show the exception // of remove() method import java.util.ArrayList; public class ArrayListDemo { public static void main(String[] args) { // create an empty array list with an initial capacity ArrayList<Integer> arrlist ...
🌐
Codidact
software.codidact.com › posts › 289778
How do I remove an element from a Java array? - Software Development
// remove the element of the array at index i int i = 0; for (int j = i; j < N - 1; j++) { A[j] = A[j + 1]; } N -= 1; This is roughly what java.util.ArrayList does underneath for its remove(int) method.