| Author |
Collections Framework
|
Marcelo Ortega
Ranch Hand
Joined: May 31, 2005
Posts: 519
|
|
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
|
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJD, SCEA/OCMJEA
Live life to an interface, not an implementation!
|
 |
Wei-ju Wu
Ranch Hand
Joined: Feb 16, 2005
Posts: 147
|
|
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
|
"The UrlyBird catches the certificate. And he's gonna FlyByNight"<br /> <br />SCJP 1.2/5.0, SCJD, SCBCD, SCWCD, SCEA
|
 |
Marcelo Ortega
Ranch Hand
Joined: May 31, 2005
Posts: 519
|
|
|
So basically, every concrete implementation inherits them, but some do not support them. Correct?
|
 |
Wei-ju Wu
Ranch Hand
Joined: Feb 16, 2005
Posts: 147
|
|
|
Well, I would not say "inherit", but "implements" since they are interfaces. Correct is, that they do not necessarily have to be supported.
|
 |
 |
|
|
subject: Collections Framework
|
|
|