您的位置:首页 > 编程语言 > Java开发

java的基本类型的长度

2016-05-13 16:53 393 查看
byte 1字节

short 2字节

int 4字节

long 8字节

float 4字节

double 8字节

char 2字节

boolean 是平台相关的

Oracle版:This means a boolean is usually a 32-bit variable. However arrays of booleans are treated as arrays of bytes, so booleans are 8 bits in an array"

sun版:可以参看这个文章。System.gc() doesn't guarantee cleaning memory. It just gives an order to the
JVM to run the garbage collection, but it doesn't mean that the collector actually cleaned something.

需要注意的问题是,不管操作系统的位数是多少,基本类型的长度都是固定的。Java程序不是直接运行在本地操作系统上,而是运行在JVM上,JVM将class程序不同的操作系统下的基础类型长度固定。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: