public static void main(String[] args) { Map<String, String> map = new HashMap<>(); map.put("name", "mao"); map.put("name", "mao"); map.put("gender", "male"); for (Entry<String, String> entry : map.entrySet()) { System.out.println(entry.getKey()+":"+entry.getValue()); } }
时间: 2024-12-07 09:04:25