Open Question
Difference between HashMap and TreeMap
  (Time Left: 0 days 0 hours)
  asked by: maxpwnge  on: Jul 22, 2009  
Answers ( 5 )

HashMap will not store the elements in order.Whereas TreeMap stores in order.so while retrieving we will get in a particular order.But for HashMap we won't.

  mushixx2   answered on:Jul 24, 2009  0 comments


good

  peanut_breath   answered on:Jul 26, 2009  0 comments


1> Treemap are sorted map while hashmap are not

  aj5122003   answered on:Jul 27, 2009  0 comments


The following link provides a table with details of collections in java.

http://mindprod.com/jgloss/collection.html


  razor90   answered on:Jul 29, 2009  0 comments



Differences...

a> HashMap provides the implementation of Map Interface by using hashtable
where as TreeMap provides the implementation of Map Interface by using Tree.

b> HashMap does not guarntee any order
TreeMap provides sorted order

  happy2smile   answered on:Jul 30, 2009  0 comments

 
Answer this Question:  Maximum Lenght of Answer:10000

 

Hot Questions

Contact Us - IT-Interview