浮点型
public class Test {
public static void main(String[] args) {
float f1 = 12.23f;
double d1 = 4562.12d;
double d2 = 45678.1564;
double result = f1+d1+d2;
System.out.println("浮点数相加达到结果为:"+result);
}
}
1
2
3
4
5
6
7
8
9
10
11
字符型
public class Test {
public static void main(String[] args) {
int i = 'd';
char c = 97;
System.out.println("字符d的Unicode码是:"+i);
System.out.println("Unicode码97代表的字符是:"+c);
}
}