Files
javaSE251223/day02/src/com/inmind/Demo04.java

16 lines
462 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.inmind;
/*
2个字节char类型在数据类型转换中是如何转换或者如何计算的
它是根据对应的码表,将字符对应的十进制的值,参与运算
*/
public class Demo04 {
public static void main(String[] args) {
//定义出一个char类型的变量
char c = '国';
//定义一个整数int变量
int i = 10;
int sum = i+c;
System.out.println(sum);//
}
}