About 12,100,000 results
Open links in new tab
  1. How to map values in a map in Java 8? - Stack Overflow

    Apr 22, 2014 · Collect the results in the resulting map: Map the entries to their key. Map the entries to the new values, incorporating String.valueOf. The reason you cannot do it in a one …

  2. How do I efficiently iterate over each entry in a Java Map?

    If I have an object implementing the Map interface in Java and I wish to iterate over every pair contained within it, what is the most efficient way of going through the map? Will the ordering of

  3. java - Iterate through a HashMap - Stack Overflow

    Jul 1, 2009 · Extracted from the reference How to Iterate Over a Map in Java: There are several ways of iterating over a Map in Java. Let's go over the most common methods and review …

  4. Map inside a map in Java - Stack Overflow

    Jul 9, 2021 · map.put("AAA", innerMap); But as of Java 8 you can create the map as a value if it doesn't exist which is then returned using computeIfAbsent If the value (i.e. map) doesn't exist …

  5. java - iterating over and removing from a map - Stack Overflow

    Dec 11, 2009 · If an item were added to this Map while it was being recursed to remove items wouldn't it still throw a ConcurrentModificationException?

  6. 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 …

  7. java - Remove entry from map without iterating - Stack Overflow

    Oct 17, 2013 · How do I remove entry from Java Map without using iteration using value or key. Basically in my map, I am using containsKey() then map.remove() to remove it.

  8. java - Map of maps - how to keep the inner maps as maps?

    Dec 3, 2016 · However, when I got each inner map, the map I created originally became an Object and I cannot use key to access its value as I do with the outer map. To learn from you …

  9. What is the easiest way to iterate over all the key/value pairs of a ...

    Feb 25, 2009 · What is the easiest way to iterate over all the key/value pairs of a java.util.Map in Java 5 and higher? Asked 16 years, 10 months ago Modified 1 year, 7 months ago Viewed …

  10. collections - Java Ordered Map - Stack Overflow

    Is there an object in Java that acts like a Map for storing and accessing key/value pairs, but can return an ordered list of keys and an ordered list of values, such that the key and value lists ar...