Java.lang.Comparable: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=External= * https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html =Internal= * Java 8 Lambda Expressions =Overview=...")
 
 
(One intermediate revision by the same user not shown)
Line 10: Line 10:


<syntaxhighlight lang='java'>
<syntaxhighlight lang='java'>
public interface Comparable<T> {


    int compareTo(T o)
}
</syntaxhighlight>
</syntaxhighlight>
A class that implements Comparable is said to have a ''natural order''.

Latest revision as of 19:11, 29 March 2018

External

Internal

Overview

public interface Comparable<T> {

    int compareTo(T o)

}

A class that implements Comparable is said to have a natural order.