package Homework;
public class Homework2_5 {
public static void main(String[] args) {
char ch1 = '你', ch2 = '我', ch3 = '他';
System.out.println(ch1 + " 字在Unicode中 "+ (int)ch1 + " 号位置");
System.out.println(ch2 + " 字在Unicode中 "+ (int)ch2 + " 号位置");
System.out.println(ch3 + " 字在Unicode中 "+ (int)ch3 + " 号位置");
}
}
运行结果
该程序展示了如何在Java中获取字符的Unicode编码值,分别输出了'你'、'我'和'他'在Unicode中的位置。

被折叠的 条评论
为什么被折叠?



