File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Why the Dictionary class is declared as abstract instead of interface? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Why the Dictionary class is declared as abstract instead of interface?" Watch "Why the Dictionary class is declared as abstract instead of interface?" New topic
Author

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

Thennam Pandian
Ranch Hand

Joined: Oct 11, 2005
Posts: 163

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

Joined: Oct 27, 2005
Posts: 19541
    
  16

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?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Thennam Pandian
Ranch Hand

Joined: Oct 11, 2005
Posts: 163
Thanks Rob.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

You're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why the Dictionary class is declared as abstract instead of interface?
 
Similar Threads
Thread Doubt
ABSTRACT
HttpServlet
Why we can't create object to ABSTRACT & INTERFACE classes?
Abstarct class & Interfaces