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’s the syntax for mod in java
- Sort an array in Java
- How to solve could not create the virtual machine error of Java Virtual Machine Launcher?
- Java String Split by “|”
- Could not reserve enough space for object heap
- Possible causes of Java VM EXCEPTION_ACCESS_VIOLATION?
- java.lang.ClassNotFoundException: com.mysql.jdbc.Driver in Eclipse
- “Char cannot be dereferenced” error
- Print ArrayList
- Unsupported major.minor version 52.0 [duplicate]
- What is a StringIndexOutOfBoundsException? How can I fix it?
- Exception in Application start method java.lang.reflect.InvocationTargetException
- Non-static variable cannot be referenced from a static context
- How to get an enum value from a string value in Java
- Round a double to 2 decimal places [duplicate]
- java.lang.ClassCastException
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘MyController’:
- Can I multiply strings in Java to repeat sequences?
- Why does cache use Most Recently Used (MRU) algorithm as evict policy?
- Difference between HashMap and Map in Java..?
- javac not working in windows command prompt
- What is a Question Mark “?” and Colon “:” Operator Used for?
- How to remove single character from a String
- How can I get list of values from dict?
- org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set
- Is there a concurrent List in Java’s JDK?
- org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set
- Quick Way to Implement Dictionary in C
- Subtracting two lists in Python
- cannot make a static reference to the non-static field
- Double cannot be dereferenced?
- Encrypt Password in Configuration Files?
- Java, Simplified check if int array contains int
- Converting a string to an integer on Android
- Error: Generic Array Creation
- How to center the text in a JLabel?
- What is the use of a private static variable in Java?
- What is method hiding in Java? Even the JavaDoc explanation is confusing
- Error: class X is public should be declared in a file named X.java
- How can I remove a substring from a given String?
- Parsing JSON string in Java
- java attempting to assign weaker access privilege error
- Getting a “no interface expected here” when I try to subclass ServiceConnection [duplicate]
- How to determine day of week by passing specific date?
- Python-like list comprehension in Java
- C# Dictionary get item by index
- set background color: Android
- Class JavaLaunchHelper is implemented in two places
- What’s the equivalent of Java’s Thread.sleep() in JavaScript?
- No Main class found in NetBeans