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

How much ram can a 64 bit processor theoretically?

960


can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread

1031


What is api data?

1047


Can we declare an array without size in java?

1061


Explain inheritance in java?

1063


What is the symbol for average?

1074


Give the difference between the println method and sqrt method?

1130


What is bytecode in java ?

1249


What is the list interface in java programming?

1167


What are the six ways to use this keyword?

1111


What invokes a thread's run() method in java programming?

1270


What are java threads?

1169


How does system arraycopy work in java?

1181


What is the purpose of using break in each case of switch statement?

1067


How do you read a char in java?

1091