I am trying to write a little class as follows:
public class MyHashMap<K,V >
extends
HashMap {
public MyHashMap add(final K key, final V value) {
put(key, value);
return this;
}
}
Eclipse is giving a warning on the "put" line that it is type unsafe.
How do I fix this?
Thanks.
Thomas Hawtin - 31 Jul 2006 13:02 GMT
> public class MyHashMap<K,V >
> extends
> HashMap {
<K,V>
> }
>
> Eclipse is giving a warning on the "put" line that it is type unsafe.
Although I'd tend to go for having the actual map as a member of that
class, rather than (ab)using inheritance.
Tom Hawtin
G. Ralph Kuntz, MD - 31 Jul 2006 18:12 GMT
That fixed it. Thanks.
> > public class MyHashMap<K,V >
> > extends
[quoted text clipped - 9 lines]
>
> Tom Hawtin