将下面三个字符AbG转换为对应的大小写输出显示,并输出对应的Unicode值。将下列数值25015、19233、20320输出显示对应的字符表示。
// 将下列数值25105、29233、20320 输出显示其对应的字符表示。
class numToChar {
public static void go() {
char a = 'A';
char b = 'b';
char g = 'G';
int aUnicode = 25105;
int bUnicode = 29233;
int gUnicode = 20320;
System.out.println("A 的大写字母是:" + Character.toUpperCase(a));
System.out.println("b 的大写字母是:" + Character.toUpperCase(b));
System.out.println("G 的大写字母是:" + Character.toUpperCase(g));
System.out.println("A 的小写字母是:" + Character.toLowerCase(a));
System.out.println("b 的小写字母是:" + Character.toLowerCase(b));
System.out.println("G 的小写字母是:" + Character.toLowerCase(g));
System.out.println("A 的 Unicode 值是:" + (int) a);
System.out.println("b 的 Unicode 值是:" + (int) b);
System.out.println("G 的 Unicode 值是:" + (int) g);
char aChar = (char) aUnicode;
char bChar = (char) bUnicode;
char gChar = (char) gUnicode;
System.out.println("Unicode 值 25105 对应的字符是:" + aChar);
System.out.println("Unicode 值 29233 对应的字符是:" + bChar);
System.out.println("Unicode 值 20320 对应的字符是:" + gChar);
}
}
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。