what is difference betwwen hashmap and hashtable ?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we declare a class static?

532


What are the Class Libraries ?

585


Is there any difference between synchronized methods and synchronized statements?

567


How do you convert string to int in java?

548


Is java still relevant?

489






Who developed java?

556


What does string intern() method do?

581


Why array is used in java?

505


What is class variable java?

575


How can we create objects if we make the constructor private ?

532


Can sleep() method causes another thread to sleep?

558


Explain about version control?

580


what is the final keyword denotes in java?

573


How many types of constructors are used in java?

532


Can the garbage collection be forced by any means?

526