Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 12fd03e

Browse files
Merge pull request Snailclimb#782 from Fuge2015/master
fix a bug: compareTo implement.
2 parents e44f9a4 + f23b71e commit 12fd03e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎docs/java/collection/Java集合框架常见面试题.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,11 @@ public class Person implements Comparable<Person> {
384384
// TODO Auto-generated method stub
385385
if (this.age > o.getAge()) {
386386
return 1;
387-
} else if (this.age < o.getAge()) {
387+
}
388+
if (this.age < o.getAge()) {
388389
return -1;
389390
}
390-
return age;
391+
return 0;
391392
}
392393
}
393394

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /