There are two remove() methods. One takes the list position as a primitive int. The other takes the list element to remove as an object.
al.remove(42) is trying to remove the value at list position 42. The list isn't that long so you get an IndexOutOfBoundsException.
al.remove(new Integer(42)) will remove the array element equivalent to the Integer object.
The remove() method takes an int and you passed an int, so
Java doesn't autobox the 42 into an object like you were expecting.
[ July 30, 2006: Message edited by: Scott Johnson ]