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程序不同的操作系统下的基础类型长度固定。
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程序不同的操作系统下的基础类型长度固定。
相关文章推荐
- Action中使用session方法
- spring MVC入门教程
- java中文乱码解决之道(一)—–认识字符集
- java之socket
- Eclipse中的文件导航插件StartExplorer
- 关于Java集合框架的总结
- Java的File类常用的api
- Java之旅--跨域(CORS)
- SpringMVC+easyUI实现上传图片功能小例子
- JavaWeb开发之深入分析请求转发和重定向的应用场景以及请求包含 (跟着龙哥学JavaWeb)
- myeclipse下SSH整合环境搭建
- <thinking in java 4>学习笔记
- eclipse工程导入Android studio 有些包无效的解决
- 在Spring Boot启动后执行指定代码
- java.math.BigDecimal cannot be cast to java.lang.String解决方法
- 在Spring Boot启动后执行指定代码
- Servlet监听器与Timer定时器配合实现JAVA WEB应用简单自动作业
- java-IO操作-使用字符流读写数据
- java生成不重复随机数
- MyEclipse中对项目分类管理