I know Dictionary has been unoffficially deprecated. But comparing Map & DIctionary, I can't find any differences.
Is there a basic design difference i missed?
Also since now its unofficially deprecated, doesn't it means we should not be encouraged to use HashTable and use ConcurrentHashMap instead.
I read somewhere that because Dictionary is an abstract class instead of an interface like Map, and because Java classes can only have 1 superclass, all of Dictionary's subclasses are forever trapped under the Dictionary inheritance tree and can't be moved to fill other rolls in other inheritance trees.
Dictionary is more like java.util.AbstractMap than the Map interface.
Joined: Oct 13, 2005
Walter Gabrielsen Iii wrote: . . . because Java classes can only have 1 superclass, all of Dictionary's subclasses are forever trapped . . .
That is correct. Also, by implementing an interface, you can make a class appear to extend two things (or more).
Both of those are advantages to implementing rather than extending something.