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 ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why set is used in java?

1022


What is a classloader in java?

1027


What is meant by JVM? Is JVM platform independent or not?

1081


How do I know if java is installed?

1091


what are abstract functions?

1030


What is unmodifiable list in java?

964


If a method is declared as protected, where may the method be accessed in java programming?

1001


Why is singleton not thread safe?

1052


What is the inheritance?

975


What is the use of singleton?

967


What is command line argument in java?

1154


Which is bigger float or double java?

983


what is a working thread? : Java thread

1046


What is square root in java?

1112


Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?

1058