On 20/11/2009, at 9:54 AM, Adam Heath wrote:


Also look at this:
http://www.angelikalanger.com/GenericsFAQ/JavaGenericsFAQ.html

Ah okay I see, so using Object doesn't modify the context but it does
allow the context to be modified whereas ? will block any attempts to
use put.

BTW, <String, ? extends Object> is the same as using <String, ?> isn't it?

No.  ? means you have no idea what kind of value is in the map.  None
at all.  All you can do with such a map is take it's size, work with
the keyset, or remove values.  You can't store values, can't do
anything with values *returned* from methods.

I't s a pure side-effect that all classes in java extend Object, but
the generics markup above doesn't consider that.


Okay thanks Adam and thanks for the link, it looks like a great reference.

Regards
Scott

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to