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 xml parsing. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "xml parsing." Watch "xml parsing." New topic
Author

xml parsing.

T sandya
Ranch Hand

Joined: Aug 03, 2006
Posts: 64
In my application,they are parsing the XML document,and putting the data in Hashmap.I am not getting why they are using Hashmap only instead of using the Hashtable.Almost in entire application they are using Hashmap only.

can any one argue me,why i cann't use Hashtable.

thanks and regards,
sandya.
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
Why Hashtable? Hashtable is synchronized to start with. HashMap will give you better performance over Hashtable.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

Hashtable versus Hashmap? Nothing to do with XML. Moving to Java in General (Intermediate).
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12911
    
    3

Because Hashtable is an old, legacy collection class, and you should not use it if there isn't a specific reason to do so.

You should always use HashMap instead of Hashtable, which is the new and more efficient dictionary collection class available since Java 1.2.

The question should not be "why are all my colleagues using HashMap instead of Hashtable"; instead, you should ask yourself "why am I using Hashtable while all my colleagues are using HashMap".


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: xml parsing.
 
Similar Threads
About String usage
Building conditional xsd schemas
Statement and PreparedStatement question?
Dynamic table generation
XML Parsing - File Locked !