06 2021 档案

摘要:数组的默认初始化值 数组元素类型 初始化值 整型(byte、short、int、long) 0 浮点型(float、double) 0.0 char型 0或‘\u0000’,而非‘0’ boolean false 引用数据类型 null 测试 public static void main(Stri 阅读全文
posted @ 2021-06-09 20:56 南方风 阅读(53) 评论(0) 推荐(0)
摘要:运算符面试题 题1 short s=3; s=s+2;//步骤1# 运算符面试题 题1 ```java short s=3; s=s+2;//步骤1 s+=2;//步骤2 //步骤1和2有什么区别 解析:步骤1报错,因为2为int型,s+2是int型,不能用short型s接收 步骤2:用+=、-=、 阅读全文
posted @ 2021-06-05 10:36 南方风 阅读(118) 评论(0) 推荐(0)
摘要:整型常量的默认值 整型常量有byte、short、int、long,默认类型int; byte b=12; byte b1=b+1;//编译报错 因为1默认是int类型,因此不能用byte接收,所以编译报错。 浮点型常量的默认值 浮点型常量有float、double,默认类型double; byte 阅读全文
posted @ 2021-06-03 20:22 南方风 阅读(182) 评论(0) 推荐(0)