Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HashTable and HashMap

 
Saurabh Saha
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Please tell me three difference between HashMap and HashTable. I know two difference. please tell me what is third one.
1.Synchronization
2.Null key and value
3.???

Thanks,
Vivek
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic