package my;
public class MyJava {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] x1;//声明一个整型数组
x1 = new int[3];//为x1数组分配内存空间3个
x1[0] = 10;
x1[1] = 20;
x1[2] = 30;
int[] x2 = new int[]{1,2,3,4};//定义一个数组,并分配内存空间,再赋值
int[] x3 = {10,11,12,13};
for (int j = 0; j < x3.length; j++) {
System.out.println(x3[j]);
}
String[] nameStrings = {"生而神灵","弱而能言","幼而寻齐","长而敦敏","成而登天"};
for (int i = 0; i < nameStrings.length; i++) {
System.out.println(nameStrings[i]);
}
}
}