Results 1 to 6 of 6
Thread: what is the difference
- 03-25-2009, 04:16 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 52
- Rep Power
- 0
- 03-25-2009, 04:32 PM #2
Not really, I dug into this and found that a TreeMap will keep things sorted, for hashtable you get a lot of people telling you it is not in use anymore. They are worng ( wrong ) seems from what I read of hashmap it is not much different from hashtable except that you do not get as many people telling you it has been replaced.
Threading issues do not matter unless you are writing a program that creates threads.Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
- 03-25-2009, 04:33 PM #3
Member
- Join Date
- Mar 2009
- Posts
- 52
- Rep Power
- 0
But i think they both does not allow null keys
is it?
- 03-25-2009, 11:38 PM #4
Member
- Join Date
- Mar 2009
- Posts
- 25
- Rep Power
- 0
yes it is. And there is one more HashMap works faster that Hashtable in a single tread environment (someone told).
- 03-26-2009, 09:38 AM #5
Member
- Join Date
- Mar 2009
- Posts
- 13
- Rep Power
- 0
Hashtable is the synchronized counterpart to HashMap. By this we mean that methods for Hashtable are synchronized.
Another difference is that while HashMap lets you have null values as well as one null key, a Hashtable doesn't let you have anything that's null.
- 01-04-2011, 04:31 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Well, most places I've seen where this (and Vector) come up are that, outside of an environment where they are shared between threads, the newer (non-thread safe versions) should be used.
Indeed, with the synchronised versions of the newer collections available (via the Collections class) it is arguable whether the older ones are required at all.
Similar Threads
-
What is the difference between
By arnab321 in forum New To JavaReplies: 2Last Post: 01-19-2009, 04:49 AM -
what is the difference between jsp and jsf?
By makpandian in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 12-31-2008, 05:55 PM -
difference
By nishant in forum New To JavaReplies: 2Last Post: 09-17-2008, 06:04 PM -
Difference between http and ftp
By islamfunny in forum CLDC and MIDPReplies: 6Last Post: 08-14-2008, 07:12 AM -
Difference between ASP and JSP
By barney in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 08-07-2007, 07:15 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks