what is the difference between HashMap and Hashtable

Answer Posted / tarun kumar

class Hashtable was part of the original java.util and is a
concreate implementation of a Dictionary class. In java2 it
is reengineering it so that it also implements the Map
interface.
Thus it is now integrated into the collections framework.

class HashMap implements Map interface.

Because, Hashtable is a concreate implementation of
Dictionary class, is Legacy class, all legacy classes are
synchronized. So,thats why Hashtable is sunchronized.

I can say that both Hashtable and HashMap are same, accept
synchronization.

Is This Answer Correct ?    22 Yes 25 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many ways can we create singleton class?

741


What is the method overriding?

835


What methods are used in Servlet?Applet communication?

1936


What is logical variable?

739


How big is a gigabyte?

842


When does an object becomes eligible for garbage collection in java?

826


What's a method in programming?

771


Can a final variable be manipulated in java?

765


How do you use compareto in java?

758


Explain purpose of sleep() method in java?

854


What is the static block?

808


What are three advantages of using functions?

770


What is the size of int?

860


What is object cloning in Java?

868


if u open login & logout ,how can udisplay the timelogin & logout members ?

1971