public class HelloWorld {
public static void main(String[] args){
//int data [] = {1,2,3};// 静态初始化 - 简略格式
int data [] = new int [] {11,22,33};// 静态初始化 - 完整格式(讲师推荐完整格式!!!)
// int data [] = new int [3];// 动态初始化
// data [0] = 11;
// data [1] = 22;
// data [2] = 33;
System.out.println("数组长度" + data.length);
for(int x = 0;x < data.length;x++){
System.out.println(data[x]);
}
}
}
标签:初始化,6.1,int,System,数组,格式,data,定义
From: https://www.cnblogs.com/pansidong/p/17454047.html