java primitive 数据类型长度

来源:互联网 发布:淘宝二级域名用什么好 编辑:程序博客网 时间:2024/05/01 22:27

Java determines the size of each primitive type. These sizes don’t change from one machine architecture to another as they do in most languages. This size invariance is one reason Java programs are portable.

Primitive type

Size

Minimum

Maximum

Wrapper type

boolean

Boolean

char

16-bit

Unicode 0

Unicode 216- 1

Character

byte

8-bit

-128

+127

Byte

short

16-bit

-215

+215—1

Short

int

32-bit

-231

+231—1

Integer

long

64-bit

-263

+263—1

Long

float

32-bit

IEEE754

IEEE754

Float

double

64-bit

IEEE754

IEEE754

Double

void

Void

All numeric types are signed, so don’t look for unsigned types.

所有的primitive数据类型都是有符号的,那么怎么表示无符号的4字节数呢?

原创粉丝点击