Answered Questions

  • What is the difference between hashmap and hashset?

    sampra

    • Mar 6th, 2012

    HashMap is not collection inteface where as HashSet is Collection interface.
    HashMap class implements Map interface where as HashSet class implements Set interface.
    HashMap is prints the elements orderly where as HashSet has no order, if you need some order then go for TreeSet.

    maheshjammula

    • Nov 28th, 2011

    HashSet and hashMap both are not maintained order.Difference is hashMap contains key value to map the corresponding value but hashSet have no key value and index value.Their implementations is another matter.