| Author |
vector: synchronized data and synchronized method
|
Yan Zhou
Ranch Hand
Joined: Sep 02, 2003
Posts: 136
|
|
One SCJD textbook says: Vector provides synchronized methods to access data, but vector itself is not synchronized data, and there is a big difference. I do not see how they are different from a programmer 's viewpoint: since all methods are synchronized, the internal data integrity of a vector is always maintained. What did I miss? Thanks. Yan
|
 |
Rovas Kram
Ranch Hand
Joined: Aug 08, 2003
Posts: 135
|
|
|
If you have a reference to an object that is contained by a Vector, you can modify the value of that object in an thread un-safe manner. The synchronization just protects the list so-to-speak not the content.
|
 |
Mr. C Lamont Gilbert
Ranch Hand
Joined: Oct 05, 2001
Posts: 1170
|
|
|
They have some really strange and confusing ways of wording those questions. I bet they think they are clear too...
|
 |
 |
|
|
subject: vector: synchronized data and synchronized method
|
|
|