GeekInterview.com
Series: Subject: Topic:
Question: 559 of 577

Differences between HashList and HashMap, Set and List

Asked by: Interview Candidate | Asked on: Sep 1st, 2005
Showing Answers 1 - 6 of 6 Answers
Ashutosh Gupta

Answered On : Jun 26th, 2005

Hashtable is synchronised and Hashmap is not. List allow duplicate entries but Set does not allow.

  
Login to rate this answer.
Srinivasa Reddy

Answered On : Aug 4th, 2005

Hashmap allows null values as key but Hashtable does not. List can store ordered elements and duplicates. Set can't allow duplecates and the order is unordered.

  
Login to rate this answer.
Pavan

Answered On : Sep 1st, 2005

HashMap is same as HashTable except that it is not Synchronized and allow null values. List is an ordered collection and it allow nulls and duplicates in it. Set doesn't allow duplicates, it may allow nulls.  I am not getting what is HashList here.

  
Login to rate this answer.
kuriakose

Answered On : Sep 29th, 2005

HashList is a data structure storing objects in a hash table and a list.it is a combination of hashmap and doubly linked list. acess will be faster. HashMap is hash table implementation of map interface it is same as HashTable except that it is unsynchronized and allow null values.     List is an ordered collection and it allow nulls and duplicates in it. positional acess is possible.                                                       Set is a collection that doesn't allow duplicates, it may allow at most one null element. same as our mathematical set.

  
Login to rate this answer.
kayalsuku

Answered On : Jun 2nd, 2008

View all answers by kayalsuku

HashMap is an unordered and unsorted map. Allow one null key and many null values. Lists are collections that maintain their elements in order, and can contain duplicates. Set interface do not allow duplicate elements. A set can contain at most one null value.A Set  is an unordered collection of distinct objects

  
Login to rate this answer.
nnandurkar

Answered On : Jun 23rd, 2010

View all answers by nnandurkar

Hashtable is syncronised where as HashMap is not. Hence, HashMap is faster.Hasttable does not allow any null value as either key or value. However, HashMap allows multiple null values and one null as a key. Set has no duplicate items and allows only one null element.List might have duplicate items and allows multiple null element.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.