Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

compare function in java

class Simpson implements Comparable<Simpson> {
    String name;

    Simpson(String name) {
        this.name = name;
    }

    @Override
    public int compareTo(Simpson simpson) {
        return this.name.compareTo(simpson.name);
    }
}
Source by www.infoworld.com #
 
PREVIOUS NEXT
Tagged: #compare #function #java
ADD COMMENT
Topic
Name
3+2 =