Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Nested wildcard is strange

843793Aug 14 2006 — edited Aug 25 2006
Hi,

I know that I can create something like this
List<?> myList = new ArrayList<Object>();
And now I want to use this in a Map
Map<String, List<?>> myMap = new HashMap<String, List<Object>>();
But the compiler complains about "Type mismatch: Cannot convert..."

Allowed is this
Map<String, List<?>> myMap = new HashMap<String, List<?>>();
Can someone explain this to me?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 22 2006
Added on Aug 14 2006
9 comments
223 views