Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
nested generic HashMap problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="markspace, post: 4064333"] Just a note, in case you missed it: I didn't put the Cache inside of Demo, all I did was add a type parameter to Cache. I think, given what you've shown us, you either have to remove the T type information from the return types in Cache (if you don't have a type, how can you guarantee that two different method calls actually correlate in their type? That's why the ? is messing you up), or you have to parameterize Cache, as I did, so the compiler can check your work. Also, I didn't modify any other code. Your program appears to me to be correct, so you could add a SupperssWarnings to the return type. But it might be better not to: There's always maintenance to consider, and keeping that SupperssWarnings valid through many code revisions, possibly not done by you, might not be easy or even possible. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
nested generic HashMap problem
Top