2023.10.17
1.
A int i =1000; B float f = 45.0; C char s = ‘\u0639’; D Object o = ‘f’; E String s = "hello,world\0"; F Double d = 100; G double d1 = 100;
A是对的
B是错的,如果声明时不加f会默认是double类型,double到float需要强制类型转换(大转小,精度丢失)
C是unicode写法,对的
D是对的
E是对的
F是错误,100是int类型,可以自动装箱成Integer,但是不能是Double
G是对的int可以转成double
标签:基本,int,double,float,Double,类型,100 From: https://www.cnblogs.com/RynerLee/p/17770998.html