It's not a secret anymore!
The moose likes Beginning Java and the fly likes HashTable and HashMap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "HashTable and HashMap" Watch "HashTable and HashMap" New topic

HashTable and HashMap

Saurabh Saha
Ranch Hand

Joined: Dec 08, 2004
Posts: 52
Hi All,
Please tell me three difference between HashMap and HashTable. I know two difference. please tell me what is third one.
2.Null key and value

Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

Since this looks very much like a homework question, I don't want to give the answer straight out. However, let me see if I can point you in the right direction.

It looks like you pulled the first two answers from the HashMap class' description in the Java API documents (i.e. the JavaDocs). The third answer is not directly verbalized in the text. But if you carefully compare the HasMap & HashTable entires, the answer is there. Also take a look at this JavaWorld article. From that you should be able to determine what another big difference between HashTable and HashMap is.
I agree. Here's the link:
subject: HashTable and HashMap
It's not a secret anymore!