A map declared to hold objects of a type T can also hold objects that extend from T
import java.util.HashMap; import java.util.Map; public class Main { public static void main(String[] argv) { Map numMap = new HashMap(); numMap.put(.5, "half"); numMap.put(1, "first"); } }