A类改为如下 class A<T> { public A(T first, T second) {
this.first = first;
this.second = second;
} public T getFirst() {
return first;
} public T getSecond() {
return second;
} public void setFirst(T newValue) {
first = newValue;
} public void setSecond(T newValue) {
second = newValue;
}
private T first;
private T second;
}
this.first = first;
this.second = second;
} public T getFirst() {
return first;
} public T getSecond() {
return second;
} public void setFirst(T newValue) {
first = newValue;
} public void setSecond(T newValue) {
second = newValue;
}
private T first;
private T second;
}
//...
}