0

The Dictionary class is now obsolete, replaced by java.util.Map interface – why?

RUstar
  • 37
  • 5
  • http://stackoverflow.com/questions/2358651/are-java-properties-effectively-deprecated – underdog Mar 06 '15 at 02:40
  • 2
    @HovercraftFullOfEels this question asks "why" while the "dup" in the link asks for differences and none of the 3 answers actually answer this one. Please re-open. – Nir Alfasi Mar 06 '15 at 02:46
  • `Hashtable` and `Properties` still both extend it. Note that none of these classes is deprecated. The motivation for the Java Collections Framework is described completely in the [Overview](https://docs.oracle.com/javase/7/docs/technotes/guides/collections/overview.html). – user207421 Mar 06 '15 at 03:03
  • 1
    Dictionary was replaced with Map, which has a much richer set of functions. Updating Dictionary to add the functionality would have likely broken a lot of exiting code. This was done at the same time that Hashtable was replaced by HashMap. One important difference between these is that Hashtable was internally synchronized while HashMap is not. As it turned out the synchronization was quite expensive and it was far from "airtight" anyway. – Hot Licks Mar 06 '15 at 03:36

0 Answers0