Complete the code to declare an integer array named numbers with size 5.
int[] numbers = new int[[1]];The array size must be 5 to hold five elements.
Complete the code to declare and initialize an array of strings with values "apple", "banana", and "cherry".
String[] fruits = [1];The correct syntax to initialize an array with values uses new String[] and curly braces.
Fix the error in the code to correctly declare an array of doubles named scores with size 4.
double[] scores = new double[1];Array size must be specified inside square brackets [].
Fill both blanks to declare and initialize an integer array named primes with values 2, 3, 5, 7.
int[] primes = [1] [2];
Use new int[] followed by curly braces with values to initialize the array.
Fill all three blanks to declare an array of booleans named flags with size 3 and initialize all values to false.
boolean[] flags = new boolean[[1]]; for(int [2] = 0; [2] < flags.length; [2]++) { flags[[3]] = false; }
The array size is 3. The loop variable is i, used to set each element to false.
