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.

Extending HashMap - Generics

843793Nov 23 2006 — edited Nov 24 2006
I fail to grasp the syntax/concept how to generically extend classes.
example/question 1. In order to retain generics, do I have to use:
MyMap<K,V> extends HashMap<K,V> 
? (Why or Why not, please.)

2. How do I extend HashMap to force the value to be of type Set<?> ?
(Let's name this subclass HashMapA.)

3. Suppose I want to extend HashMapA so that its key is an Integer?

TIA
nat
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 22 2006
Added on Nov 23 2006
15 comments
542 views