我在学习 Java Generic 时遇到了一些问题:
interface calculator<T, R> {
public void execute(T t, R r);
}
class executeAdd<T, R> implements calculator<T, R> {
private T first;
private R second;
public executeAdd(T first, R second) {
super();
this.first = first;
this.second = second;
}
@Override
public void execute(T t, R r) {
// TODO Auto-generated method stub
Object o = t + r // ERROR ! What i could do it ?
}
}