The API mentions that Vector and Hashtable are synchronized. I'm curious what actually is synchronized and how I could tell from the API that it is synchronized? You can't synchronize a class and none of the methods that I can see listed have the modifier synchronized so what is that is actually makes these classes synchronized? ( I know I don't need to know much more than that they are synchronized for the test, but I'm just curious ). TIA, Rick
The synchronized keyword is an implementation detail, like native, so it's not going to show up in the API docs. Basically, every call in Vector and Hastable that gets an object, or sets an object, is synchronized. If you really want to look at the methods themselves, look at the source code for Vector and Hashtable. Source for all the Java classes comes with the JDK, usually in a file called src.jar.
Joined: Apr 03, 2001
Thanks, Rob, that makes sense. I didn't think of it synchronizing on the objects which I'd only see in implementation within the source code.