We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93694bf commit bdc8dd4Copy full SHA for bdc8dd4
02-Sorting-Basic/Course Code (Java)/02-Selection-Sort-Using-Comparable/src/bobo/algo/Student.java
@@ -18,15 +18,12 @@ public Student(String name, int score){
18
@Override
19
public int compareTo(Student that) {
20
21
- if( this.score == that.score )
22
- return this.name.compareTo(that.name);
23
-
24
if( this.score < that.score )
25
return -1;
26
else if( this.score > that.score )
27
return 1;
28
else // this.score == that.score
29
- return 0;
+ return this.name.compareTo(that.name);
30
}
31
32
// 定义Student实例的打印输出方式
0 commit comments