| 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
|
|
|
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
|
|
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
|
 |
 |
|
|
subject: xml parsing.
|
|
|