how to initialize array with different value java code example
Example 1: java initialize array with same value
Arrays.fill(array, -1);
Example 2: initialize array with values java
int[] arr = {3,6,9,12};
int[] arr = new int[]{1, 2, 3};
Arrays.fill(array, -1);
int[] arr = {3,6,9,12};
int[] arr = new int[]{1, 2, 3};