0

Other than the way hashtable handles NPE, if a hashmap is synchronized using Collections framework, how does it differ in behavior from hashtable, if at all it does ?

ChaseMedallion
  • 20,860
  • 17
  • 88
  • 152
JavaDeveloper
  • 5,320
  • 16
  • 79
  • 132

1 Answers1

1

There are some not essential differences, eg Hashtable has elements() method which return Enumeration. But most importantly some old classes depend on Hashtable eg javax.naming.InitialContext and you cannot substitute it with a Map which Collection.synchronizedMap returns.

Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275