I am storing a double value inside the a HashMap as shown
HashMap listMap = new HashMap();
double mvalue =0.0;
listMap.put("mvalue",mvalue );
Now when i tried to retrieve that value , as shown
mvalue = Double.parseDouble((String) listMap.get("mvalue"));
i am getting an error as
java.lang.Double cannot be cast to java.lang.String
I am confused here ,
This is my actual HashMap and i am setting the values in it as shown
HashMap listMap = new HashMap();
double mvalue =0.0 ;
List<Bag> bagList = null;
listMap.put("bagItems",bagList);
listMap.put("mvalue", mvalue);
Could anybody please tell me , how the structure of the HashMap should be ?