Here are some possible problems with the remove() method on a List.
If you try to remove an object from a list while you're using an iterator on the list, the remove will fail. Use the remove method of iterator instead. Here's an example:
Another problem that might occur is misunderstanding the remove(Object o) method. When you pass an object to remove() instead of an index, the first object in the list that meets the criteria: listObject.equals(o) will be removed. For most classes you've created, this
test will only be true if listObject and o are exactly the same instance of the class. To change this behavior, you must override the equals() method in the class to define equality between two instances of the class.
So, in your example, if you consider two instances of Book to be equal if they have the same ISBN property, you would override the equals(Object o) method that Book inherits from Object so that it returns true if the ISBN properties are the same.
[ April 30, 2006: Message edited by: Merrill Higginson ]