Home Technology Subscribe to RSS

Give A Scenario Where A Hash Table And Hash Map Is Used?

Answer Question

1 Answer - Sort by: Date | Rating

    Hi,

    HashMap has a key and a set of values. Using general life example - you have a
    phonebook in which you have a name (key) and contact details for that name (Values).  HashMap or Hashtable is used in similar examples when a key has associated to it many values and that the values are searched using thier key.


    Both HashMap and Hash table provide key-value access to data. Basically both provide similar functionality. There is no major difference between them.


    One of the minor differences between them are:
    1- HashMap is fail-safe , Hash table is not.
    2- HashMap allows null values in it while Hash table doesn't



    Click here to find out more on what you can do with HashMap.
    http://mindprod.com/jgloss/hashmap.html#SAMPLEUSE

    http://www.jguru.com/faq/view.jsp?EID=430247
    1 0

    Nsk  

    answered 2 years ago

      More

         
         

        Ask a Question via Twitter

        Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

        Blurtit Store

        Get T-shirts, hoodies, caps and more at the Blurtit store

        Blurtit International