I'm rusty on my Java polymorphism.
If I have a class Merchandise, and then a class Clothing that extends Merchandise, why aren't I able to do the following?
HashMap<String, Merchandise> stuff = new HashMap<String, Clothing>();
When I do so, I am getting this compilation error:
DataStore.java:5: error: incompatible types: HashMap<String,Clothing> cannot be converted to HashMap<String,Merchandise>
public static HashMap<String, Merchandise> tshirts = new HashMap<String, Clothing>();
Aren't all Clothing items also Merchandise items? ^