Java 中存储布尔值需要多少字节?
布尔值是单开闭,可以以一位表示。然而,我读到,一种语言通常会使用更多字节,以便更有效地访问它们。
Java中具体的字节数是多少?
Possible Duplicate:
What is the size of a boolean variable in java?
Java - boolean primitive type - size
A boolean value is a single-on off and could be represented in one bit. However, I have read that a language often uses more bytes are them to be accessed more efficiently.
What is the specific number of bytes in Java?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Oracle 在此处提供了数据类型和大小的完整列表:
http://download.oracle.com/javase/tutorial/java/ nutsandbolts/datatypes.html
不幸的是,该页面指出:
这个答案似乎提供了为什么大小没有精确定义的原因。
Oracle has a complete list of the data-types and sizes here:
http://download.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
Unfortunately, that page states:
This answer seems to provide the reasoning of why the size isn't precisely defined.