Skip to Main Content

New to Java

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!

How to extend Hashmap ?

801487Dec 9 2008 — edited Dec 9 2008
Hi Friends,
I am trying to define a custom class that should extend Hashmap, I tried this:
public class MyClass extends HashMap<Score,Integer>{
     public MyClass(){
      //not sure what should be passed here to super
      super(Score,Integer);
     }
}
I need to initialize it like this:
MyClass map = new MyClass<Score,Integer>();
Can you please help.
Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 6 2009
Added on Dec 9 2008
27 comments
7,671 views