■ 第一种:
int[] arr=new int[6]; arr[0] = 1; arr[1] = 2 arr[2] = 3; arr[3] = 4; arr[4] = 5; arr[5] = 6;
■ 第二种:
int[] arr = {1,2,3,4,5,6};
■ 第三种:
int[] arr = new int[]{1,2,3,4,5,6};
■ 第一种:
int[] arr=new int[6]; arr[0] = 1; arr[1] = 2 arr[2] = 3; arr[3] = 4; arr[4] = 5; arr[5] = 6;
■ 第二种:
int[] arr = {1,2,3,4,5,6};
■ 第三种:
int[] arr = new int[]{1,2,3,4,5,6};