It may be a really stupid question , I have a java code which is as follows :
public Collection<Object> getCollection(){
List<Map<String,Object> listMap = getListMap();
return listMap;
}
I am getting an exception saying
cannot assign a value of Java.util.list<java.util.map<java.lang.String,java.lang.Object>>
to java.util.Collection<java.lang.Object>
Of course the error must be valid , But why is that ? And how can i overcome this ?