我的问题是这是做什么的:
<RecentActivity, RecentActivityController>
这段代码的意思是:
public class RecentActivity extends AbstractActionActivity<RecentActivity, RecentActivityController>
其实我想知道<和>运算符的概念。 有人可以提供引用以了解它们吗?
最佳答案
这被称为泛型,这里的 AbstractActionActivity 是一个接受两个参数的泛型类。例如,来自 oracle 教程:
public class Box<T> {
// T stands for "Type"
private T t;
public void set(T t) { this.t = t; }
public T get() { return t; }
}
As you can see, all occurrences of Object are replaced by T. A type variable can be any non-primitive type you specify: any class type, any interface type, any array type, or even another type variable.
可以进一步了解here
关于java - <> 在类名中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41779479/