If you synchronize on a HashMap object, is there any difference (at that point) between a Hashtable and a HashMap? If so, please explain. Also, for a Hashtable (or a synchronized HashMap) object, should you synchronize on an Object contained with the map prior to updating its contents? If so, would it be better to synchronize the method on the Object that updates the contents?
Joined: Mar 04, 2004
The synchronized HashMap would still permit nulls, which the Hashtable doesn't. The Hashtable would still support some older methods that the HashMap doesn't (such as the elements() method).