Correct me if I'm wrong but I believe that restricts the map to only
accepting values that are exactly Object.  It will not allow things
that extend Object, only Object themselves.  You could use:

Map<String,? extends Object>

Which is just a long-hand way of saying:

May<String,?>
You can't put things into Maps that have wildcards. The compiler complains because Object really isn't '?'. Although most language pragmatist would tell you it is. But the language zealots say otherwise, and those are the folks who wrote generics. :)

If you use Object, you can put anything into the Map because the compiler will insert a cast to (Object), which with autoboxing allows everything in the Java language to be used. The key to remembering generics for me is that up-casting is cool, down-casting isn't and wildcards are read-only.

-bp

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to