About 8,010,000 results
Open links in new tab
  1. What is a hash map in programming and where can it be used

    Apr 7, 2010 · Hashmap is used for storing data in key value pairs. We can use a hashmap for storing objects in a application and use it further in the same application for storing, updating, …

  2. collections - What are the differences between a HashMap and a ...

    What are the differences between a HashMap and a Hashtable in Java? Which is more efficient for non-threaded applications?

  3. What is the difference between the HashMap and Map objects in …

    Jan 5, 2017 · 64 Map is an interface that HashMap implements. The difference is that in the second implementation your reference to the HashMap will only allow the use of functions …

  4. How to preserve insertion order in HashMap? - Stack Overflow

    I'm using a HashMap. When I iterate over the map, the data is returned in (often the same) random order. But the data was inserted in a specific order, and I need to preserve the …

  5. How to directly initialize a HashMap (in a literal way)?

    This creates an anonymous subclass of HashMap, whose instance initializer puts these values. (By the way, a map can't contain twice the same value, your second put will overwrite the first …

  6. java - How to for each the hashmap? - Stack Overflow

    As you have HashMap<String, HashMap>, you would need two loops - one for the outer and one for the inner HashMap. Btw - you should definitively type the second HashMap - don't know …

  7. Is a Java hashmap search really O (1)? - Stack Overflow

    For a hash table resolving collisions with chaining (like Java's hashmap) this is technically O (1+α) with a good hash function, where α is the table's load factor. Still constant as long as the …

  8. Get keys from HashMap in Java - Stack Overflow

    May 5, 2012 · I have a Hashmap in Java like this: private Map<String, Integer> team1 = new HashMap<String, Integer> (); Then I fill it like this: team1.put ("United", 5); How can I get the …

  9. java - Time Complexity of HashMap methods - Stack Overflow

    On an average, the time complexity of a HashMap insertion, deletion, and the search takes O (1) constant time in java, which depends on the loadfactor (number of entries present in the hash …

  10. ¿Cuál es la diferencia entre HashMap y Hashtable en JAVA?

    Dec 17, 2015 · Otra diferencia importante es que Hashtable no permite llaves o valores null, mientras que HashMap permite una llave y cualquier vantidad de valores null. Orden de …