public class Declaration {}
public class Class_object extends Declaration{}
above is my class declaration, so basically Class_object is subclass of class Declaration.
Map<String,ArrayList<Declaration>> structure = new HashMap<String,ArrayList<Declaration>>();
ArrayList<Class_object> co = new ArrayList<Class_object>();
structure.put("CLASS", co);//here gives error:The method put(String, ArrayList<Declaration>) in the type Map<String,ArrayList<Declaration>> is not applicable for the arguments (String, ArrayList<Class_object>)
In another class, I try to create a hashmap to contain different subclasses of Declaration, but it gives me error message. Could anyone tell me how to fix it?