Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

14条最后一句 这一句话不太理解 #132

Open
victory-wu opened this issue Aug 12, 2021 · 0 comments
Open

14条最后一句 这一句话不太理解 #132

victory-wu opened this issue Aug 12, 2021 · 0 comments

Comments

@victory-wu
Copy link

Technical discussion or constructive comments(技术讨论或建议的详细描述):

总之,无论何时实现具有排序性质的值类,都应该让类实现 Comparable 接口,这样就可以轻松地对实例进行排序、搜索,并与依赖于此接口的集合实现进行互操作。在 compareTo 方法的实现中比较字段值时,避免使用 < 和 > 操作符,应使用包装类中的静态比较方法或 Comparator 接口中的 comparator 构造方法。

14条最后一句
这一句话不太理解

在 compareTo 方法的实现中比较字段值时,避免使用 < 和 > 操作符,应使用包装类中的静态比较方法或 Comparator 接口中的 comparator 构造方法。

能有正确和错误的例子吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant