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

Which is faster set or list in java?

988


Difference between comparator and comparable in java?

1037


Write a java program that prints all the values given at command-line.

982


Explain 5 io best practices?

984


Is hashset ordered java?

1044


Can we sort set in java?

918


Which containers use a flowlayout as their default layout in java programming?

949


Differences between C and Java?

1132


What is an example of a constant variable?

1026


What is lambda expression in java?

977


What class allows you to read objects directly from a stream?

1290


Can we overload destructor in java?

938


Is there any limitation of using inheritance?

1033


How to write custom exception in java?

1018


Does set allows null in java?

916