How can I remove specific object from ArrayList?
Suppose I have a class as below:
import java.util.ArrayList;
public class ArrayTest {
int i;
public static void main(String args[]){
ArrayList<ArrayTest> test=new ArrayList<ArrayTest>();
ArrayTest obj;
obj=new ArrayTest(1);
test.add(obj);
obj=new ArrayTest(2);
test.add(obj);
obj=new ArrayTest(3);
test.add(obj);
}
public ArrayTest(int i){
this.i=i;
}
}
How can I remove object with new ArrayTest(1)
from my ArrayList<ArrayList>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…