I'm storing data in a HashMap with (key: String, value: ArrayList). The part I'm having trouble with declares a new ArrayList "current," searches the HashMap for the String "dictCode," and if found sets current as the returned value ArrayList.
ArrayList current = new ArrayList();
if(dictMap.containsKey(dictCode)) {
current = dictMap.get(dictCode);
}
The "current =..." line returns a compiler error of:
Error: incompatible types
found : java.lang.Object
required: java.util.ArrayList
I don't understand this... does that HashMap return an Object instead of the ArrayList I stored in it as the value? How do I convert this object into an ArrayList?
Thank you.