I’m not very skilled in java generics, I must admit. But here’s the problem.
I need to subclass LinkedList to add some (not all) methods typical of a Map. Let’a say I do this way:
public class TalendList<T extends Serializable> extends ArrayList<T>{
private Map<T, T> map;
public TalendList(){
super();
map = new ConcurrentHashMap<T, T>();
}
Is this the correct way? Why I cannot do this in my caller code:
List<String> ggg = new TalendList<String>();
but only:
TalendList<String> ggg = new TalendList<String>();
?
This is happening because you are importing:
instead of:
The awt type of List doesn’t support the parameterizing, and it is not a generic collection.