LList<T extends Comparable>
so LList
accepts only classes that extends Comparable as type parameter.
LList <LList<Integer>> subArrsList = new LList <LList<Integer>>();
in this statement you are giving LList<Integer>
class as type parameter. LList<Integer>
does not extend Comparable
.
Integer extends comparable but you are not using the Integer class as type parameter, You are using LList which does not extends Comparable.
So you are getting an error.
Change your LList
class as follows:
public class LList <T extends Comparable <T>> implements Comparable<LList<T>>{
@Override public int compareTo(LList<T> list) {
//to do
}
...// your code
}