Is People
in the following Java snippet a type name (like T
or K
) or a concrete class (or interface) name?
public class Student implements Comparable<People> { ... }
And where can I find explanation or specification on such issue?
In this context, People
is the name of a concrete class, not a type variable. If you wanted it to be a type variable, you'd have to say that Student
itself is a generic:
public class Student<People> implements Comparable<People> { ... }
By the way, notationally, wildcards like T
and K
that are stand-ins for classes are usually called type variables rather than types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With