Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java compareto jdei stackoverflow

public int compareTo(Jedi jedi){
    int result = this.name.compareTo(jedi.getName());
    if(result == 0){
        result = this.age > jedi.age ? 1 : this.age < jedi.age ? -1 : 0;
    }
    return result;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #compareto #jdei #stackoverflow
ADD COMMENT
Topic
Name
6+8 =