关于java的数组

JAVA学习网 2019-10-02 21:50:02

一定要写成

int[] arr = new int[30]

这样每个元素默认为0;

介样子的

如果写成

int[] arr = {1,2,3,4};

那么他的长度就是4

阅读(2376) 评论(0)