1.动态方法(指定数组的长度) int[] arr = new int[3]; 2.静态方法(指定数组的元素) int[] arr = new int[]{1,2,3,4,5}; int[] arr = {1,2,3,4,5};