Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java in General
Joined: Aug 03, 2006
Sep 07, 2006 01:13:00
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,
Joined: May 24, 2003
Sep 07, 2006 02:08:00
Why Hashtable? Hashtable is synchronized to start with.
will give you better performance over Hashtable.
Joined: Oct 14, 2005
Sep 07, 2006 09:54:00
Hashtable versus Hashmap? Nothing to do with XML. Moving to Java in General (Intermediate).
Jesper de Jong
Joined: Aug 16, 2005
Sep 08, 2006 01:29:00
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
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
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
- My blog about Scala
I agree. Here's the link:
subject: xml parsing.
Statement and PreparedStatement question?
XML Parsing - File Locked !
Building conditional xsd schemas
About String usage
Dynamic table generation
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013