数据类型

基本类型

整数类型

  • byte:占1个字节范围,-128 - 127
  • short:占2个字节范围,-32768 - 32767
  • int:占4个字节范围,-2147483648 - 2147483647
  • long:占8个字节范围,-9223372036854775808 - 9223372036854775807

浮点类型

  • float:占4个字节
  • double:占8个字节

字符类型

  • char:占2个字节

boolean类型

  • boolean:占1位,值只有true和false

引用类型

  • 接口
  • 数组
posted @ 2023-02-21 16:49  joken屮  阅读(52)  评论(0)    收藏  举报