gpt4 book ai didi

java国际化规则

转载 作者:行者123 更新时间:2023-11-29 08:06:11 25 4
gpt4 key购买 nike

Java Internationalization Rules .它说要替换

s1.compareTo(s)==0

Collator.compare(s1,s2)<0

为什么 <0

最佳答案

基于 the Javadoc , 这是一个错字 - 应该是 ==:

Returns an integer value. Value is less than zero if source is less than target, value is zero if source and target are equal, value is greater than zero if source is greater than target.

这是针对 Collat​​or.compareString 重载(如链接示例比较 String),但是 the general version of the method行为方式相同。

您间接引用的文章链接到 the corresponding page of the Java Tutorial , 它描述了与上述一致的行为。

关于java国际化规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11046363/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com