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<Number, String> numMap = new HashMap<Number, String>(); numMap.put(.5, "half"); numMap.put(1, "first"); } }