In the API for this method it can be read: " ClassCastException - if the class of the specified element prevents it from being added to this Set. IllegalArgumentException - if some aspect of this element prevents it from being added to this Collection. " But you can't get a ListIterator for a Collection or Set compile-time type so I guess the words Set and Collection should be replaced by List, as in the ListIterator.set() method
SCJP2. Please Indent your code using UBB Code
posted 15 years ago
Yup, looks like an error. But fortunately it's easy enough to figure out what they meant. You can submit a bug report and your name will become immortalized in Java history.