This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void exercise4() { | |
Map<String, Integer> map = new TreeMap<>(); | |
map.put("c", 3); | |
map.put("b", 2); | |
map.put("a", 1); | |
StringBuilder result = new StringBuilder(); | |
map.entrySet() | |
.forEach(entry -> | |
result.append(entry.getKey()) | |
.append(entry.getValue())); | |
System.out.println(result.toString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment