CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS J2EE JAVA DETAILS
Question :
What is the difference between Hashmap and Hashtable?
Category Java Interview Questions
Rating (4.8) By 24 users
Added on 11/8/2005
Views 2447
Rate it!
Answers:

All the Mehods in HashTable are synchronized whereas HashMap is not thread-safe.

Another big difference is that HashMap allows null key and null values whereas HashTable does not permit null key and null values.

Submitted by Bikramjit Bardhan (Bikramjit.Bardhan@ps.net)

_____________

1--HashMap is a New Java Class , where as HashTable is Old.



2?HashMap is not Synchronized where as hashTable is.



3?HashMap allows null as both key and value, where as HashTable does?nt allow null.



4?HashMap retrieval is not in order (random). HashTable provide ordered retrieval.

Submitted by Sameer Shukla (Sameer.Shukla@orange.co.in)



Hash table is thread safe, hash map is not



 Posted by: ravikanth    

Contact ravikanth  Contact ravikanth


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
What is the difference between Vector, Array and Arraylist?
View Answer
What is the difference between final, finally and finalized?
View Answer
What is the difference between String and StringBuffer?
View Answer
What is the difference between exception and error?
View Answer
What is the difference between List, Set and Map?
View Answer
What is the difference between Observable and Observer?
View Answer
What is the difference between Eventlistener and Eventadapter?
View Answer
What is the difference between Classpath and Import?
View Answer
What is the difference between Iterator and Enumeration?
View Answer
What is the difference between Comparable and Comparator?
View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL Java Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/823/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.81