java 怎么打印acsii中的A的值
可以使用下面的代码来打印ASCII中的A的值:
char ch = 'A';
int asciiValue = (int) ch;
System.out.println("The ASCII value of A is: " + asciiValue);
输出结果为:
The ASCII value of A is: 65
其中,将字符类型的变量强制转换为整型变量,可以得到其对应的ASCII值。
原文地址: http://www.cveoy.top/t/topic/hw1i 著作权归作者所有。请勿转载和采集!