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 the difference between HashMap and Hashtable

Answers were Sorted based on User's Feedback



what is the difference between HashMap and Hashtable..

Answer / brijendra kumar soni(xavient)

1-Hashmap is nonSyncronized whereas Hastable is Syncronized.

2-Hashmap allows both key and values are Null whereas
Hastable doesnot allow Null values.

3-Hasmap belongs to Collection package whereas Hashtable is
a class.

4-The class Hashmap implements the map interface whereas
Hastable implements the class.

Is This Answer Correct ?    1 Yes 0 No

what is the difference between HashMap and Hashtable..

Answer / avinash

1. Hash map is not is synchornized
2. Hash map is allow null value only at once.
3. iterator is fail safe

1.Hash table is synchronized.
2. Hash table isnot allow null value.
3. enum hashtable is not.

Is This Answer Correct ?    1 Yes 0 No

what is the difference between HashMap and Hashtable..

Answer / rohit

Hash table is Synchronized whereas Hash map is Asynchronized.
Hash Map allows one null key and multiple null values
whereas Hash Table does not allow null...

Is This Answer Correct ?    1 Yes 0 No

what is the difference between HashMap and Hashtable..

Answer / jyotsna gupta

1. Hashtable is synchronized where as hashmap is not.
2. Hashmap can contains null values as the keys and as well as values.But Hashtable dose not allow null values as keys and values.
3. 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.
4. Hashmap is faster than Hashtable.

Is This Answer Correct ?    2 Yes 2 No

what is the difference between HashMap and Hashtable..

Answer / chandan

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.

Is This Answer Correct ?    0 Yes 0 No

what is the difference between HashMap and Hashtable..

Answer / 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

what is the difference between HashMap and Hashtable..

Answer / mohamed

no comments

Is This Answer Correct ?    12 Yes 16 No

Post New Answer

More Core Java Interview Questions

Can you achieve runtime polymorphism by data members?

0 Answers  


Do you know thread pools?

0 Answers   BMC,


What is an array and a vector? How they different from each other?

4 Answers  


What do you mean by exception handling in Java?

0 Answers   Atos Origin,


What is the exact difference in between Unicast and Multicast object?

0 Answers  


What means public static?

0 Answers  


What is java Applet?

0 Answers   TCS,


How does indexof work?

0 Answers  


what is mean by ooad? where we are using? can you tell me any real time example?

1 Answers   Eka Software,


what is ejb? what is the importance of ejb?

2 Answers   Photon,


What is the meaning of course?

0 Answers  


I want to persist data of objects for later use. What’s the best approach to do so?

0 Answers  


Categories