You can prepare effectively for Software Development Basics of Java with this dedicated MCQ Practice Test (available with solutions) on the important topic of "Test: Arrays - 1". These 15 questions have been designed by the experts with the latest curriculum of Software Development 2026, to help you master the concept.
Test Highlights:
Sign up on EduRev for free to attempt this test and track your preparation progress.
Detailed Solution: Question 1
Detailed Solution: Question 2
Detailed Solution: Question 3
Detailed Solution: Question 4
Which of the following statements about multidimensional arrays in Java is true?
Detailed Solution: Question 5
What will be the output of the following code?
int[] numbers = {1, 2, 3, 4, 5};
System.out.println(numbers[3]);
Detailed Solution: Question 6
What will be the output of the following code?
int[] values = new int[5];
System.out.println(values[2]);
Detailed Solution: Question 7
What will be the output of the following code?
int[] numbers = new int[3];
System.out.println(numbers.length);
Detailed Solution: Question 8
What will be the output of the following code?
int[] numbers = {1, 2, 3, 4, 5};
System.out.println(numbers[numbers.length - 1]);
Detailed Solution: Question 9
What will be the output of the following code?
int[][] matrix = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
System.out.println(matrix[1][2]);
Detailed Solution: Question 10
What will be the output of the following code?
int[] numbers = {1, 2, 3, 4, 5};
int sum = 0;
for (int i = 0; i < numbers.length; i++) {
sum += numbers[i];
}
System.out.println(sum);
Detailed Solution: Question 11
What will be the output of the following code?
int[] array = {1, 2, 3, 4, 5};
int max = array[0];
for (int i = 1; i < array.length; i++) {
if (array[i] > max) {
max = array[i];
}
}
System.out.println(max);
Detailed Solution: Question 12
What will be the output of the following code?
int[] array = {5, 10, 15, 20};
int target = 15;
int index = -1;
for (int i = 0; i < array.length; i++) {
if (array[i] == target) {
index = i;
break;
}
}
System.out.println(index);
Detailed Solution: Question 13
What will be the output of the following code?
int[] array = {1, 2, 3, 4, 5};
int target = 6;
boolean found = false;
for (int i = 0; i < array.length; i++) {
if (array[i] == target) {
found = true;
break;
}
}
System.out.println(found);
Detailed Solution: Question 14
What will be the output of the following code?
int[] array = {2, 4, 6, 8, 10};
int target = 5;
int count = 0;
for (int i = 0; i < array.length; i++) {
if (array[i] % 2 == 0) {
count++;
}
}
System.out.println(count);
Detailed Solution: Question 15
55 videos|49 docs|12 tests |