wt7018

注意:在赋值运算的时候,会自动发生数据类型转变

例子

public class test{
    public static void main(String[] args){
        byte num = 5;
        // num = num + 10 => byte = byte + int => byte 数学运算中自动提升 => byte = int + int => byte = (byte)15 
        num += 10;
        System.out.println(num); // 15
    }
}

python 不用定义数据类型,对这个感觉比较迟钝

分类:

技术点:

相关文章:

  • 2021-08-07
  • 2021-11-16
  • 2022-01-27
  • 2021-12-14
  • 2021-11-11
猜你喜欢
  • 2021-09-10
  • 2022-12-23
  • 2021-12-05
  • 2021-09-01
  • 2021-09-09
  • 2021-07-28
相关资源
相似解决方案