int[] score = new int[5];
int[] score;
score = new int[30];
int[] score = {20,65,85,94,25};
int[] score = new int[]{20,65,85,94,25};
本文介绍了在Java中使用不同方式初始化整型数组的方法。包括直接定义数组大小、分配内存并指定大小以及初始化数组元素的具体数值等。
int[] score = new int[5];
int[] score;
score = new int[30];
int[] score = {20,65,85,94,25};
int[] score = new int[]{20,65,85,94,25};
2万+
4508
1916
1429

被折叠的 条评论
为什么被折叠?