This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exceptions thrown by ListIterator.add(Object)  RSS feed

 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!