The difference between the two declarations is that the first generates a warning about the compiler, and the second does not. This is because generic types should always be used with parameters.
This declaration ensures that if X implements a vector, it must be a vector X:
class X implements Vector<X> {
...
Anything else will result in a compiler error.
In fact, this design is used in the JDK:
public abstract class Enum<E extends Enum<E>> implements Comparable<E>, Serializable {
...
this means that when we declare an listing of X, it (implicitly) extends Enum<X>
source
share