what is difference betwwen hashmap and hashtable ?

Answers were Sorted based on User's Feedback



what is difference betwwen hashmap and hashtable ?..

Answer / deep pratap singh

HashMap HashTable
1> Not Synchronized Synchronized
2> can contain null cann't

You may also make HashMap Synchronized using generic
methods. Using Hashtable is bad habit. Try to avoid it.

Is This Answer Correct ?    10 Yes 2 No

what is difference betwwen hashmap and hashtable ?..

Answer / ravikiran

hashmap allows one null key and multiple null values.
hashtable doesn't allow null elements
hashmap is not synchronized
hashtable is snchronized
hashmap is not legacy
hashtable is legacy

Is This Answer Correct ?    6 Yes 0 No

what is difference betwwen hashmap and hashtable ?..

Answer / ajay yadav

Hash Map allows null values.
Hash Table dont allows null values.

Is This Answer Correct ?    4 Yes 0 No

what is difference betwwen hashmap and hashtable ?..

Answer / javablossom

The Iterator is used in the hashmap is fail-safe and
whereas the Enumerator used in hashtable is not fail-safe.

Is This Answer Correct ?    1 Yes 0 No

what is difference betwwen hashmap and hashtable ?..

Answer / sekhar

Both class are under map interface.But hash table is
synchronized.hashMap is not.we can explictly synchronize
hash map by using the method
Collections.synchronizedMap(Hash Map);

Is This Answer Correct ?    1 Yes 1 No

what is difference betwwen hashmap and hashtable ?..

Answer / kvn

Hash map contains null values,but hash table does not.

Is This Answer Correct ?    1 Yes 3 No

what is difference betwwen hashmap and hashtable ?..

Answer / guest

dfg

Is This Answer Correct ?    2 Yes 6 No

Post New Answer

More Core Java Interview Questions

What is default specifier ??? Use of default specifier ???

4 Answers   Cognizant, Syntel,


What is anti pattern in programming?

0 Answers  


What are the important features of Java 11 release?

0 Answers  


How do you declare an array that will hold more than 64KB of data?

0 Answers   Aspire, Infogain,


What is int lol?

0 Answers  






Is char a data type in java?

0 Answers  


Which browsers work with java?

0 Answers  


What is the difference between math floor and math round?

0 Answers  


If A Class Is Declared Without Any Access Modifiers, Where May The Class Be Accessed?

0 Answers   Wipro,


what is the purpose of using rmisecuritymanager in rmi?

0 Answers  


What is the difference between sleep and wait in java?

0 Answers  


we know that every java prog must follows OOPS Principles. Anybody can answer, HOW THE FOLLOWING PROGRAM FOLLOWS OOPS CONCEPTS i.e, Inheritance,Polymarphism,Encapsulation? class a{ public static void main(String args[]){ System.out.println("Hello World"); } }

3 Answers  


Categories