数组new实例方法
int data[] = new int[3];
int date[] = {1, 2, 4, 545, 11, 32, 13131, 4444};
int date[] = new int[] { 1, 2 };
错误定义示例:
以为int[]有类似类的构造函数: new int[](2)
不能两边都有数字:new int[2]{1,2}; 多余了[]内的2
大小
用.length~(联想记忆:数组没有继承collection接口,所以不是size);
数组new实例方法
int data[] = new int[3];
int date[] = {1, 2, 4, 545, 11, 32, 13131, 4444};
int date[] = new int[] { 1, 2 };
错误定义示例:
以为int[]有类似类的构造函数: new int[](2)
不能两边都有数字:new int[2]{1,2}; 多余了[]内的2
大小
用.length~(联想记忆:数组没有继承collection接口,所以不是size);