代码:
new HashMap<String,Integer>() {{put("a", 0);put("b", 0);put("c", 0);}};
用处:
for (Entry<String, String> entry : set) {value = entry.getValue();try {if(k == 5) {break;}json = new JSONObject(value);update_map.put(entry.getKey(), new Update(0, json, new HashMap<String,Integer>() {{put("a", 0);put("b", 0);put("c", 0);}}));queue.add(entry.getKey());k++;} catch (JSONException e) {e.printStackTrace();}}