**
数组的静态和动态的初始化
**
public class Array01 {
public static void main(String[] args) {
//动态创建数组
int[] ints = new int[7];
//或者int[] ints=new int[7]{1,2,3,4,5,6};
ints[0]=1;
ints[1]=2;
ints[2]=3;
ints[3]=4;
ints[4]=5;
ints[5]=6;
//动态数组的遍历
for (int i = 0; i <ints.length-1 ; i++) {
System.out.println(ints[i]);
}
//静态数组创建
int[]ints1={1,2,3,3,4};
//静态数组的遍历
for (int i = 0; i <ints.length-1 ; i++) {
System.out.println(ints1[i]);
}
}
}