Skip to content

Instantly share code, notes, and snippets.

@jmaciasluque
Created August 11, 2015 13:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jmaciasluque/29c92196ed7ad06b954f to your computer and use it in GitHub Desktop.
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