Java数组可以通过以下几种方式进行初始化:
int[] arr = {1, 2, 3, 4, 5};
int[] arr = new int[5];
arr[0] = 1;
arr[1] = 2;
arr[2] = 3;
arr[3] = 4;
arr[4] = 5;
int[] arr = new int[5]; // 默认初始化为0
int[][] arr = {{1, 2, 3}, {4, 5, 6}};
int[] arr = new int[]{1, 2, 3, 4, 5};