Some examples of bad design, that the LN class appears not to have all its fields private.
Below is my full code. For the insertOrder method I am tying to insert a set of integers in order using recursion. The following error results in relation to the method:
operator < cannot be applied to T,T (SEE METHOD BELOW). My original question was, Can i take this same method and convert it into a void type rather than returning a node?
Instead of T it's T extends Comparable<? super T> and that bit in the if would be a.compareTo(b) < 0.
I see you have your node as an inner class; that way you gain access to its private fields. I still think you are better off putting addNext() removeNext() etc. methods inside the inner Node class.
You want your objects to be mutually comparable. That means that T must be bound to Comparable<T> - this ensures that each object has a method "compareTo(T)".
However, not all classes implement Comparable themselves; java.sql.Timestamp for instance extends java.util.Date which implements Comparable<Date>. Therefore, Timestamp implements Comparable<Date> too, not Comparable<Timestamp>. By using Comparable<? super T> you allow classes like Timestamp themselves - classes that are not just comparable to the class itself but to some super class as well.