Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to declare an integer array named numbers.
Java
int[] [1];🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
2fill in blank
mediumComplete the code to initialize the array with 5 elements.
Java
int[] numbers = new int[[1]];🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
3fill in blank
hardFix the error in the array initialization syntax.
Java
int[] numbers = [1] {1, 2, 3, 4, 5};
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
4fill in blank
hardFill both blanks to declare and initialize an array with values 10, 20, 30.
Java
int[] [1] = [2] {10, 20, 30};
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
5fill in blank
hardFill all three blanks to create an array of strings with names and print the first element.
Java
String[] [1] = [2] {"Alice", "Bob", "Charlie"}; System.out.println([3][0]);
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
