728x90
Map<String, String> myMap = new HashMap<String, String>() {{
put("a", "b");
put("c", "d");
}};
https://stackoverflow.com/questions/6802483/how-to-directly-initialize-a-hashmap-in-a-literal-way
How to directly initialize a HashMap (in a literal way)?
Is there some way of initializing a Java HashMap like this?: Map<String,String> test = new HashMap<String, String>{"test":"test","test":"test"}; What would be the correct syntax? I
stackoverflow.com
728x90
'공부 (@Deprecated)' 카테고리의 다른 글
| [JavaScript] request XMLHttpRequest (promise & async ~ await) (0) | 2021.11.28 |
|---|---|
| [NewAutoReplyBot-Helper] API (0) | 2021.11.28 |
| [Java] String[] strings = list.toArray(String[]::new); (0) | 2021.11.27 |
| [JavaScript] window.scrollTo(0,document.body.scrollHeight); (0) | 2021.11.24 |
| [Java] resolve a java.util.ArrayList$SubList notSerializable Exception (0) | 2021.11.24 |