Map and Map
阿新 • • 發佈:2019-02-11
Map<String, List<Object>> map = new TreeMap<String, List<Object>>(); LinkedList<String> linkedList = new LinkedList<String>(); linkedList.add("jingjun.liu"); linkedList.add("heqing.qu"); linkedList.add("kai.yin"); map.put("names", linkedList);
Map<String, List<?>> map = new TreeMap<String, List<?>>(); LinkedList<String> linkedList = new LinkedList<String>(); linkedList.add("jingjun.liu"); linkedList.add("heqing.qu"); linkedList.add("kai.yin"); map.put("names", linkedList); List<Double> arrayList = new ArrayList<Double>(); arrayList.add(10.1); arrayList.add(100.2); map.put("prices", arrayList);