【发布时间】:2023-04-07 04:46:01
【问题描述】:
这是我的代码:
public class Configuration <T extends Map<K,V>, K, V> {
public Map<K, V> fields;
public Configuration() {
this.fields = new T<K, V>(); // --> error: Type 'T' does not have type parameters
}
}
为什么我不能用泛型参数定义泛型对象?
【问题讨论】: