正在加载图片...
自动升级规则 1.(byte或 short op int→丶int 2(byte或 short或int) op long→long 3(byte或 short或int或long) op float→foat 4.(byte或 short或int或long或 float) op double→ double 5. char op int→int 其中,箭头左边表示参与运算的数据类型 √op为运算符(如加、减、乘等) 右边表示运算结果的数据类型。 如:3+4.5,因为45是 float型,所以3先被转换为 float型,然 后再于45相加,其结果也为 float型。自动升级规则 1. (byte或 short) op int → int 2. (byte或 short或 int) op long → long 3. (byte或 short或 int或 long) op float → float 4. (byte或 short或 int或 long或 float) op double → double 5. char op int → int 其中,箭头左边表示参与运算的数据类型 op为运算符(如加、减、乘等) 右边表示运算结果的数据类型。 如:3+4.5,因为4.5是float型,所以3先被转换为float型,然 后再于4.5相加,其结果也为float型
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有