Map to String in Java

前端 未结 2 886
感情败类
感情败类 2020-12-09 00:34

When I do System.out.println(map) in Java, I get a nice output in stdout. How can I obtain this same string representation of a Map in a variable w

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 01:12

    You can also use google-collections (guava) Joiner class if you want to customize the print format

提交回复
热议问题