Removing object / element in List / ArrayList in Java a bit tricky. For instance, if we have ArrayList
1 | listItem.remove(new Integer(index)); |
But this way not working for listItem contains objects. To remove, we should pass object itself.
1 | listItem.remove(Object); |