como hago un metodo remove(Integer n) en la clase MyIntCollection para que me elimine "n" de la coleccion
------------------------------------------------------------------------------------------------------
import java.util.ArrayList;
public class MyIntCollection extends ArrayList<Integer> {
private int smallestInt;
private int largestInt;
private int total;
public MyIntCollection() {
super();
total = 0;
}
public boolean add(int i) {
if (this.isEmpty()) {
smallestInt = i;
largestInt = i;
}
else {
if (i < smallestInt) smallestInt = i;
if (i > largestInt) largestInt = i;
}
total = total + i;
return super.add(i);
}
public int getSmallestInt() {
return smallestInt;
}
public int getLargestInt() {
return largestInt;
}
public double getAverage() {
return ((double) total)/((double) this.size());
}
public void printInfo(){
System.out.println("\nMyIntCollection collection contains " + this.size() +
" int values");
System.out.println("The smallest value is: " + this.getSmallestInt());
System.out.println("The largest value is: " + this.getLargestInt());
System.out.println("The average is: " + this.getAverage());
}
}