Is there a logical reason why E cannot implement my interface HasName?
public class SinglyLinkedList<E extends HasName> {
// stuff...
}
The extends
keyword applies to interfaces too. That is:
public class SinglyLinkedList<E extends HasName> {
Means that E
must be a type that extends a class, or implements an interface, called HasName
.
It is not possible to code E implements HasName
- that is implied by E extends HasName
.