Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is difference between hash mapping and hash table?

Answer Posted / khalid

Both provide key-value access to data. The Hashtable is one
of the original collection classes in Java. HashMap is part
of the new Collections Framework, added with Java 2, v1.2.
The key difference between the two is that access to the
Hashtable is synchronized on the table while access to the
HashMap isn't. You can add it, but it isn't there by
default.

Another difference is that iterator in the HashMap is fail-
safe while the enumerator for the Hashtable isn't. If you
change the map while iterating, you'll know.

And, a third difference is that HashMap permits null values
in it, while Hashtable doesn't.

For new code, I would tend to always use HashMap.

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a class have an interface?

989


Is ++ operator is thread safe in java?

959


What happens to the Exception object after handling an exception?

2370


What is the inheritance?

975


What will happen to the exception object after exception handling?

996


Why collection doesn’t extend cloneable and serializable interfaces?

1103


What do you understand by classes in java?

1007


Write a program to reverse a number in java?

1089


What methods are used to get and set the text label displayed by a button object?

1016


What happens if constructor is private?

1029


What comes to mind when someone mentions a shallow copy in java?

1110


os is developed in c no java is more secured then c na why dont the os developed is developed using java

4229


Discuss about garbage collector in Java.

1079


What is the static keyword?

1086


What is structure of java heap? What is perm gen space in heap?

1126