import java.util.ArrayList;
public class List extends ArrayList{
public List() {
this.add(1);
this.add(2);
this.add(3);
for (int list : this)
System.out.println(list);
int x = 2;
if (this.remove(new Integer(x)))
for (int list : this)
System.out.println(list);
else
System.out.println("无该元素");
}
public static void main(String[] args) {
new List();
}
}