I have my hash map of type:
private HashMap<String, HashMapObject> likesYearHashMap;
where HashMapObject :
public class HashMapObject {
private int count;
private String id;
public HashMapObject(int count, String id) {
super();
this.count = count;
this.id = id;
}
}
how to convert values into my HashMap to HashMapObject [] array?
I get error of cast getting likesYearHashMap.values();
Map#values()returns aCollection. Iterate over it and add its element to your array.