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

What is final keyword in java?

554


Find the value of a specified element of the array arr[i] where 0 <= i <= n-1

541


which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?

9230


What is class forname used for?

540


When parseint method can be used?

541






What are methods and how are they defined?

603


What is gc()?

579


How does java pattern compile work?

546


What is this keyword in java?

563


What's the difference between an abstract class and interface in java?

559


Can a hashset contain duplicates java?

497


Is a copy constructor?

576


What is java lang object?

529


Is 0 true or is 1 true?

516


What is null object in java?

572