I want to store LinkedHashMap
value into double
type array
. How to do that ?
I tried in this way
Double[] avg= (Double[]) averageMap.values().toArray();
where averageMap
is:
LinkedHashMap<String, Double> averageMap = new LinkedHashMap<String, Double>();
but I have the following exception :
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.Double;