difference between HashMap, Hashset and hashTable?

Answer Posted / sujitpingale

HashMap -
1) unsynchronized and unordered
2) Allow one null key , multiple null values


HashTable -
1) synchronized and unordered
2) Doesn't allow null key and value


HashSet -
1) synchronized and ordered
2) Sort elements in ascending order , doesn't allow duplicate elements

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a clone?

781


Which javutil classes and interfaces support event handling?

780


What is local interface. How values will be passed?

761


What is the relationship between an event-listener interface and an event-adapter class?

770


What state does a thread enter when it terminates its processing?

809


What is the difference between session and entity beans?

791


How messaging services are done, before release of JMS?

1803


To what value is a variable of the string type automatically initialized?

867


How to deploy Jar, War files in J2EE?

2378


what is a non-repeatable read?

2028


Why does the option tag render selected=selected instead of just selected?

919


What are the different class loaders used by jvm?

809


Describe, in general, how java's garbage collector works?

737


A user of a web application sees a jsessionid argument in the URL whenever a resource is accessed. What does this mean? a. The form must have the field jsessionid b. URL rewriting is used as the session method c. Cookies are used for managing sessions

2013


Is the infobus client side only?

853