what is the difference between HashMap and Hashtable

Answer Posted / avinash

1. Hash map is not is synchornized
2. Hash map is allow null value only at once.
3. iterator is fail safe

1.Hash table is synchronized.
2. Hash table isnot allow null value.
3. enum hashtable is not.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can an interface be defined inside a class?

522


Can we sort a map in java?

578


What is the purpose of checked and unchecked exceptions in JAVA?

571


Difference between abstract and concrete class ?

583


What is arguments in java?

525






What is the finalize method do?

604


2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?

1841


What is constructor chaining in java?

587


Explain wait(), notify() and notifyall() methods of object class ?

602


Why lambda expression is used in java?

576


What is the base class of all exception classes?

588


Can we make the abstract methods static in java?

591


State differences between C and Java?

669


Is the empty set a singleton?

544


What is serialization in java?

570