The get method defined in Map accepts an Object as the key, it doesn't enforce 
the generic 
constraint since you are not modifying the contents of the Map (and thus 
supposedly not doing 
anything dangerous).

Lothar Kimmeringer wrote:
> Francisco schrieb:
>>              HashMap<String, Integer> map = new HashMap<String, Integer>();
>>              OtherStringClass otherTestString = new 
>> OtherStringClass(testString);
> [...]
>>              Integer fromOhter = map.get(otherTestString);
> 
> How can this compile? OtherStringClass can't be derived from java.lang.String
> and isn't in your code.
> 
> 
> Regards, Lothar
> 
> > 
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to