Java基本类型总结

Java数据类型(type)可以分为两大类:基本类型(primitive types)和引用类型(reference types)。

基本类型(primitive types) 包括boolean类型以及数值类型(numeric types)。

numeric types又分为整型(integer types)和浮点型(floating-point type)。

下列表格大体上规划的数据类型:

primitive

numeric

integer

byte

8bit

[-27,27-1]

short

16bit

[-215,215-1]

int

32bit

[-231,231-1]

long

64bit

[-263,263-1]

floating-point

float

32bit

1.最小正标准值的常量,即 2-126

2.最小正非零值的常量,即 2-149

3.最大正有限值的常量,即

(2-2-23)·2127

double

64bit

1.最小正标准值的常量,即 2-1022

2.最小正非零值的常量,即 2-1074

3.最大正有限值的常量,即

(2-2-52)·21023

boolean

 

 

 

true false

char

 

 

 

[0, 65535]

void

 

 

 

 

reference

class type

 

 

 

 

interface type

 

 

 

 

array type

 

 

 

 

null type

 

 

 



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值