Skip to content

Commit 93694bf

Browse files
committed
Student compareTo bug fixed.
1 parent 60dfc1d commit 93694bf

File tree

1 file changed

+2
-2
lines changed
  • 02-Sorting-Basic/Course Code (Java)/02-Selection-Sort-Using-Comparable/src/bobo/algo

1 file changed

+2
-2
lines changed

02-Sorting-Basic/Course Code (Java)/02-Selection-Sort-Using-Comparable/src/bobo/algo/Student.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public int compareTo(Student that) {
2222
return this.name.compareTo(that.name);
2323

2424
if( this.score < that.score )
25-
return 1;
26-
else if( this.score > that.score )
2725
return -1;
26+
else if( this.score > that.score )
27+
return 1;
2828
else // this.score == that.score
2929
return 0;
3030
}

0 commit comments

Comments
 (0)