Getting incompatible error for parent child classes java
问题 I have a HashMap defined: HashMap<String,ArrayList<Thing>> hashmap = new HashMap<>(); I do need an ArrayList since I want one key to have multiple values. This was the best solution I found for that problem. The Thing class is a parent class for a bunch of other classes. Problem is when I try to add I get an error. hashmap.put(b, world.ports); This is the error: no suitable method found for put(String,ArrayList<SeaPort>) method Map.put(String,ArrayList<Thing>) is not applicable (argument