Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Revisions

3 of 4
improved formatting.

A simple way to see the key value pairs:

Map<String, Integer> map = new HashMap<>();
map.put("a", 1);
map.put("b", 2);
System.out.println(Arrays.asList(map)); // method 1
System.out.println(Collections.singletonList(map)); // method 2

Both method 1 and method 2 output this:

[{b=2, a=1}]
Mingfei
  • 1.7k
  • 1
  • 13
  • 14

AltStyle によって変換されたページ (->オリジナル) /