Java recursive sort verification function for a linked list It should return true, if there is no element that follow or the following elements are greater than their predecessors.
public class Element { 
    private int value; 
    private Element next;

    public boolean isSorted(){
        if (this.next == null)
            return true;
        else return (this.value &lt; this.next.value &amp;&amp; this.next.isSorted());
    }
}

What do you guys think of it?
I would like to add few improvements for better readability.

You don't need an else statement; rather you should directly return it.

For every if and else statement, even if it is a single line and Java allows it without braces, it's not preferable because of possible code bugs which may arise in future due to missing braces.

Better to put (this.value &lt; this.next.value) in brackets for better readability.


So the updated code should look like:
public boolean isSorted() {
    if (this.next == null) {
        return true;
    }
      
    return (this.value &lt; this.next.value) &amp;&amp; this.next.isSorted();
}