public class Java01 {
public static void main(String[] args) {
// (1)创建数组
// 说明:[]表示数组类型
// 说明:数组的长度一旦创建就不能更改!
// 方式一:
int[] a = {5, 3, 2, 6};
// 方式二:
// new关键字:表示创建一个新的数组。
// [4]:表示这个数组的长度是4、数组中存储元素的个数
// 默认值:整数0、浮点数0.0、布尔false
int[] b = new int[4];
}
}
本文暂时没有评论,来添加一个吧(●'◡'●)