Map<Long, Double> map = new HashMap<Long, Double>().put(11L, 22D);//compile error
Map<Long, Double> map = new HashMap<Long, Double>();
map.put(11L, 22D);//correct
提示:
Type mismatch: cannot convert from Double to Map<Long,Double>
怎么识别成Double去了
------解决方案--------------------
put方法返回值是Double,又怎么可能转为Map<Long, Double>?
编译报那么明显的错误,你还问?