Possible Duplicate:
What are the reasons why Map.get(Object key) is not (fully) generic
According to the javadocs (http://java.sun.com/javase/6/docs/api/java/util/Map.html) for the Map interface, the definition of get is
V get(Object key) Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
Code Example:
Map<InstrumentInfo, Double> moo = new HashMap<InstrumentInfo,Double>();
moo.get(new Integer(5));
I would expect that the above code will throw an exception or at least give a warning.
I would expect that with generics and type safety, the get method would take in a parameter of type . What is the reason for taking in type Object and not ?