how to initialize array in java of given number code example Example: java initialize int array int[] arr = new int[n];