在代码中,如果我写了这样一行代码:
GClass<Double> x = new GClass<Double>();
假设这个类长这样:
public static class GClass<T> {
private T value = null;
public GClass() {
// What is T?
}
}
在我插入问题“什么是T?”的地方,我不想要值(即null
),而是它的类型(即Double
)。