0

How to remove an element from array in java?

29th Jul 2017, 6:49 PM
Spider
2 Réponses
+ 3
You can't remove an element from array in Java. You can only change it's value. But you can add and remove elements in Java collections, such as ArrayList or LinkedList
29th Jul 2017, 7:30 PM
Eligijus Silkartas
Eligijus Silkartas - avatar
+ 1
Just make the value the default value. For example, in a string array, if you want the 1st element removed then just make it null.
29th Jul 2017, 10:08 PM
Rrestoring faith
Rrestoring faith - avatar