// 动态初始化
int[] arr = new int[5];
int i;
for( i = 0; i < arr.length; ++i)
{
System.out.println("请输入一个数:");
Scanner scanner = new Scanner(System.in);
arr[i] = scanner.nextInt();
}
for(i = 0; i < arr.length; ++i)
{
System.out.println(arr[i]);
}
//静态初始化
int[] arr = {10, 54, 24, 64};
int i;
for(i = 0; i < arr.length; ++i)
{
System.out.println(arr[i]);
}