The exact intent of your code is unclear, but I got an error for the <E>
in myListInt<E>
.
public interface myListInt <E extends Comparable<E>>{}
public class myList<E extends myListInt<E>> extends LinkedList{}
^ Error here
This is because you need to constrain E
to extend Comparable<E>
in order to be a valid bound for myListInt<E>
:
public class myList<E extends Comparable<E> & myListInt<E>>
extends LinkedList{}
However, you maybe also want to add a constraint to LinkedList
too (assuming this is java.util.LinkedList
:
public class myList<E extends Comparable<E> & myListInt<E>>
extends LinkedList<E> {}