sách gpt4 ai đã đi

java char的unicode值

In lại 作者:行者123 更新时间:2023-12-01 23:06:02 26 4
mua khóa gpt4 Nike

当我执行 Collection.sort(List) 时,它将根据 String 的compareTo() 逻辑进行排序,其中它会逐个字符地比较两个字符串。

    List file1 = new ArrayList();
file1.add("1,7,zz");
file1.add("11,2,xx");
file1.add("331,5,yy");
Collections.sort(file1);

我的理解是 char 意味着它指定 unicode 值,我想知道 char 的 unicode 值,例如,(逗号)等。我该怎么做?有任何 url 包含这些数值吗?

1 Câu trả lời

My understanding is char means it specifies the unicode value, I want to know the unicode values of char like ,(comma) etc

嗯,有一个从 char đến số nguyên 的隐式转换,您可以轻松打印出来:

int value = ',';
System.out.println(value); // Prints 44

Đây là char 的 UTF-16 代码单元。 (正如 fge 所指出的,Java 中的 char 是 UTF-16 代码单元,而不是 Unicode 字符。存在大于 65535 的 Unicode 代码点,它们表示为两个 UTF-16 代码单元。)

Any url contains the numeric value of these?

是 - 有关 Unicode 的更多信息,请访问 Unicode web site .

关于java char的unicode值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22735379/

26 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com