byte,int,short,long,float,double,char占几个字节?能表示的最大最小值是多少?

您所在的位置:网站首页 java数据基本类型各占字节的多少 byte,int,short,long,float,double,char占几个字节?能表示的最大最小值是多少?

byte,int,short,long,float,double,char占几个字节?能表示的最大最小值是多少?

2024-07-05 05:01| 来源: 网络整理| 查看: 265

Java中有8种基本数据类型byte,int,short,long,float,double,char,boolean;其中:

byte占1个字节8位,取值范围为-2^7~2^7-1

int占4个字节32位,取值范围为-2^31~2^31-1

short占2个字节16位,取值范围为-2^15~2^15-1

long占8个字节64位,取值范围为-2^63~2^63-1

float占4个字节32位,取值范围为3.402823e+38 ~ 1.401298e-45

double占8个字节64位,取值范围为1.797693e+308~ 4.9000000e-324

char占2个字节16位,取值范围为0~65535 

boolean即true或false

 

更多内容,点击了解: http://how2j.cn/k/variable/variable-type/259.html



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3