java how to initialize an array with values and size code example Example: java how to initialize an array int[] arr = new int[10]; //Can hold 10 elements