-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1.5
-
x86
-
windows_nt
Name: joT67522 Date: 01/12/98
Please save the following code into a file named
a.java, compile and run it. You will be getting
the following output:
result1=0;
result2=1
The output should have been both 1 s since both
"file access" and "fileaccess" are bigger than
"file" . Thanks.
-----------a.java------------------------------
import java.text.Collator;
import java.util.Locale;
public class a
{
public static void main(String[] args)
{
Collator collator = Collator.getInstance(Locale.US);
String reference = "file";
String compare1 = "file access";
String compare2 = "fileaccess";
int result1 = collator.compare(compare1, reference);
int result2 = collator.compare(compare2, reference);
System.out.println("result1=" + result1);
System.out.println("result2=" + result2);
}
}
(Review ID: 22801)
======================================================================
- duplicates
-
JDK-4065540 java.text.Collator.compare() is broken
- Closed