• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Collection  RSS feed

 
Arun Gokul
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone tell me the difference between hashtable and hashmap in collection package with some real time examples?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arun gokul E.J.:
Could anyone tell me the difference between hashtable and hashmap in collection package with some real time examples?


This post should be in java forum....

Difference:note the spell ;)

Hashtable :
1.methods are synchronized
2.not accept a null
3.enumeration method is available
HashMap :
1.methods are not synchronized
2.accept one null key and many null values
3.enumeration method is not available
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question is placed in wrong section of forum, there are Java Beginner section , seek it !!

and about question , this is what API says :

....(The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls.)...
 
Amit Ghorpade
Bartender
Posts: 2856
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arun gokul E.J. welcome to Javaranch,
Looks like your name does not follow the Javaranch Naming policy.

Also please CarefullyChooseOneForum and UseAMeaningfulSubjectLine.

And take some time to read the Ask good questions link below.
Thanks
[ July 23, 2008: Message edited by: Amit Ghorpade ]
 
camilo lopes
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See! here
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!