Loading
Hashtable HashMap HashSet

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  What is the Differance between Hashtable/HashMap? What is HashSet ?


  • Hashtable/HashMap/HashSet
    Sample Img 25

Ans)

A Hashtable is one implementation of that interface, for the "old" days when it was thought that having everything synchronized is a good idea (ref. Vector). It offers "kind of" thread-safety, if you know what you are doing. If you are serious about a map which can be used from multiple threads you should absolutely check out the ConcurrentHashMap and ConcurrentSkipListMap.

A HashMap is almost the same as a Hashtable, but with the synchronization removed. It's the preferred general-purpose Map implementation.

HashSet does not allow duplicate values. It provides add method rather put method. You also use its contain method to check whether the object is already available in HashSet. HashSet can be used where you want to maintain a unique list.



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

Hashtable HashMap HashSet


Hashtable HashMap HashSet

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free