How can I remove specific object from ArrayList? Suppose I have a class as below:
import java.util.ArrayList;
public class ArrayTest {
int i;
pu
In general an object can be removed in two ways from an ArrayList (or generally any List), by index (remove(int)) and by object (remove(Object)).
In this particular scenario: Add an equals(Object) method to your ArrayTest class. That will allow ArrayList.remove(Object) to identify the correct object.