Map<String, String> map = ... for (Map.Entry<String, String> entry : map.entrySet()) { System.out.println(entry.getKey() + "/" + entry.getValue()); }
On Java 10+:
for (var entry : map.entrySet()) { System.out.println(entry.getKey() + "/" + entry.getValue()); }
Related Posts:
- How to sort Map values by key in Java?
- What is the difference between the HashMap and Map objects in Java?
- Sort a Map
by values - What are the differences between a HashMap and a Hashtable in Java?
- How to use Collections.sort() in Java?
- When to use LinkedList over ArrayList in Java?
- Difference between Arrays.asList(array) and new ArrayList
(Arrays.asList(array)) - How do you create a dictionary in Java? [closed]
- I’m getting Key error in python
- Initialization of an ArrayList in one line
- How do I merge dictionaries together in Python?
- How to sort an ArrayList?
- When is del useful in Python?
- C++ Loop through Map
- Difference between HashSet and HashMap?
- Iterate through a HashMap [duplicate]
- Iterate through a HashMap [duplicate]
- Why is there no SortedList in Java?
- Java Ordered Map
- Angular map. What is it?
- Map like structure in C: use int and struct to determine a value
- How to convert List
to int[] in Java? - Python – How to fix “ValueError: not enough values to unpack (expected 2, got 1)”
- Printing HashMap In Java
- How to find if a given key exists in a C++ std::map
- How to convert int[] into List
in Java? - Dictionary text file
- HashSet vs. ArrayList
- FIFO based Queue implementations?
- How can I print out C++ map values?
- Create a List of primitive int?
- Easiest way to convert a List to a Set in Java
- What is the easiest/best/most correct way to iterate through the characters of a string in Java?
- Recursion vs. Iteration (Fibonacci sequence)
- How to convert int[] to Integer[] in Java?
- Change priorityQueue to max priorityqueue
- Collections.emptyMap() vs new HashMap()
- Any implementation of Ordered Set in Java?
- Any implementation of Ordered Set in Java?
- How can you print a variable name in python? [duplicate]
- Most efficient way to increment a Map value in Java
- Python AttributeError: ‘dict’ object has no attribute ‘append’
- Why is a ConcurrentModificationException thrown and how to debug it
- How to sort a HashSet?
- Union or intersection of Java Sets
- Why are there no hashtables in the C standard library?
- When to use a Map instead of a List in Java?
- Iterative Fibonacci code in Java?
- Map vs Object in JavaScript
- How to iterate (keys, values) in JavaScript?
- What does Java option -Xmx stand for? [duplicate]
- How do I convert a String to an int in Java?
- What does Java option -Xmx stand for? [duplicate]
- Is there an invisible character that is not regarded as whitespace?
- Problem with gif with transparent background
- For-each over an array in JavaScript
- Finding white rectangle in an image
- 1000 * 60 * 60 * 24 * 30 results in a negative number [duplicate]
- How to convert nanoseconds to seconds using the TimeUnit enum?
- Search for words with telephone numbers from 2-3-4 tree
- Iterating over dictionaries using ‘for’ loops
- How to do associative array/hashing in JavaScript
- Using or ‘|’ in regex [duplicate]
- How to format strings in Java
- How do I sort a dictionary by value?
- What is the difference between x86 and x64
- How do I sort a dictionary by value?
- && (AND) and || (OR) in IF statements
- How to use the toString method in Java?
- What is a NullPointerException, and how do I fix it?
- What exactly is Apache Camel?
- Unable to find valid certification path to requested target – error even after cert imported
- Unable to find valid certification path to requested target – error even after cert imported
- What is the equivalent of the C++ Pair
in Java? - Java – Convert integer to string [duplicate]
- Getting random numbers in Java [duplicate]
- What is an instance variable in Java?
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- Java: “error: cannot find symbol”
- How does the Java ‘for each’ loop work?
- How do I sort a dictionary by value?
- Which is the difference between Long.valueOf(0) and 0L in Java?
- What is a StackOverflowError?
- Use of “instanceof” in Java [duplicate]
- How to uninstall Eclipse?
- Check if a given key already exists in a dictionary
- Is GNU’s Java Compiler (GCJ) dead? [closed]
- How does System.out.print() work?
- How do I “decompile” Java class files? [closed]
- How do I determine whether an array contains a particular value in Java?
- How to initialize an array in Java?
- How does the Java ‘for each’ loop work?
- Java 8 Iterable.forEach() vs foreach loop
- Initialize part of an array in java
- How can I solve Exception in thread “main” java.lang.NullPointerException error [duplicate]
- How to split a string in Java
- What does “Could not find or load main class” mean?
- What does “Could not find or load main class” mean?
- How to overcome TypeError: unhashable type: ‘list’