1、new对象型,并指定初始长度
int[ ] arr = new int[5]; // 创建长度为5 的数组
2、直接初始化特定值型
int[ ] arr = {1,2,3,4};
3、new对象+初始化值型
int[ ] arr = new int[]{1,2,3,4};
1、new对象型,并指定初始长度
int[ ] arr = new int[5]; // 创建长度为5 的数组
2、直接初始化特定值型
int[ ] arr = {1,2,3,4};
3、new对象+初始化值型
int[ ] arr = new int[]{1,2,3,4};
上一篇:大数据概论
本文简要介绍了Java循环创建对象内存溢出如何解决。
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M