字符‘1’在计算机中代表的意义是对应的阿斯克码,所以如果要将字符‘1’转化为数字1,就要利用阿斯克码的相减得出数字1。
public static void main(String[] args) {
char a='1';
char b='0';
int c=a-b;
System.out.println(c);
结果:
字符‘1’在计算机中代表的意义是对应的阿斯克码,所以如果要将字符‘1’转化为数字1,就要利用阿斯克码的相减得出数字1。
public static void main(String[] args) {
char a='1';
char b='0';
int c=a-b;
System.out.println(c);
结果: