1. 程式人生 > >Map and Map

Map and Map

        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);