Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why the Dictionary class is declared as abstract instead of interface?  RSS feed

 
Thennam Pandian
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The Dictionary class is the abstract class, which doesn't have any concrete methods.

All of it's methods are abstract methods. Why this class declared as abstract?

Why this class is not declared as interface ?
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dictionary is an obsolete relic that was created in Java 1.0. Sun's programmers made quite a lot of programming mistakes back then*, and this is one of those. Ignore the entire class and just use Map.

* How about Stack extending Vector instead of using one internally? Or Observable being an abstract class instead of an interface, with an abstract implementing class AbstractObservable like the current Observable to make it easier for people to implement it? Or Hashtable, Vector and StringBuffer being synchronized even though there isn't any reason for that?
 
Thennam Pandian
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob.
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!