This is a simple exercise from Chapter 2 of the Sun Certified Java Associate Study Guide that i'm having trouble with. When I try to compile the class below, I get the following error message:
"error: type ArrayList does not take parameters ArrayList hookSizesList = new ArrayList<>;"
import java.lang.Iterable;
public class ArrayList {
public static void main(String[] args) {
Integer hookSizeList;
ArrayList<Integer> hookSizesList = new ArrayList<Integer>();
hookSizesList.add(1);
hookSizesList.add(4);
hookSizesList.add(5);
for (Integer hook: hookSizesList) System.out.print(hook + " ");
}
}
I'd really appreciate any help in advance, thanks!