My tree Map is
Map<String, Double> restrMap = new TreeMap<String, Double>();
While adding the below two value to the treeMap, it only shows one. The second value, when comes updates the first one.
6, 8.00 6, 5.00
How can I add two values for the same key, perhaps in different rows?
如果要向同一个键添加多个值,请考虑使用列表映射。
Map<String, List<Double>> restrMap = new TreeMap<String, List<Double>>();
Java没有multimap,但您可以在map值中使用另一个容器。
Map<String, List<Double>> restrMap = new TreeMap<String, List<Double>>();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.