File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Collections Framework

 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Khalid's last chapter (Collections), when he talks about OPTIONAL basic operations, what exactly does he mean?

i.e
boolean add(Object obj) //said to be optional
boolean remove(Object obj) //said to be optional
 
Wei-ju Wu
Ranch Hand
Posts: 147
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

this means that these operations do not need to be fully implemented, if you have a look at the API documentation, an operation may throw UnsupportedOperationException if a concrete implementation of the List interface does not support the add(Object obj) method.

Wei-ju
 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So basically, every concrete implementation inherits them, but some do not support them. Correct?
 
Wei-ju Wu
Ranch Hand
Posts: 147
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I would not say "inherit", but "implements" since they are interfaces. Correct is, that they do not necessarily have to be supported.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic