一定要写成
int[] arr = new int[30]
这样每个元素默认为0;
介样子的
如果写成
int[] arr = {1,2,3,4};
那么他的长度就是4
关于java的数组
原文:https://www.cnblogs.com/Jensonyang/p/11616848.html