想知道什么the first <E> in the <E> Set<E>意味着什么?
例如,在以下代码中;
我知道它是一个返回类型的公共静态方法Set<E>,但从未见过<E> Set<E>?
public static <E> Set<E> union(Set<E> s1, Set<E> s2) {
Set<E> result = new HashSet<E>(s1);
result.addAll(s2);
return result;
}
Run Code Online (Sandbox Code Playgroud)
任何有关相同的帮助/参考将不胜感激.