This quiz covers basic concepts of arrays in programming, focusing on array indexing, length, and element identification in Java.
A[2]
A{2}
A[3]
A(3)
Rate this question:
2.0
3.4
3.5
5.5
Rate this question:
Int[] a = new int(2);
Int a() = new int[2];
Int a = new int[2];
int a[] = new int[2];
Int[] a = new int[2];
4
5
0
6
Rate this question:
Index variable
Indexed variable
Array
Array variable
Rate this question:
The program compiles and runs fine and the output "Value is 2.0" is printed.
The program has a compile error because the syntax new double[]{1, 2, 3} is wrong and it should be replaced by {1, 2, 3}.
The program has a compile error because the syntax new double[]{1, 2, 3} is wrong and it should be replaced by new double[3]{1, 2, 3};
The program compiles and runs fine and the output "Value is 1.0" is printed.
Rate this question:
I
(int)(Math.random() * 100))
I + 10
Math.random() * 100
Rate this question:
He program compiles and runs fine and the output "Value is 2.0" is printed.
The program has a compile error because the syntax new double[]{1, 2, 3} is wrong and it should be replaced by {1, 2, 3}.
The program has a compile error because the syntax new double[]{1, 2, 3} is wrong and it should be replaced by new double[3]{1, 2, 3};
The program has a compile error because the syntax new double[]{1, 2, 3} is wrong and it should be replaced by new double[]{1.0, 2.0, 3.0};
Rate this question:
4
2
1
3
Rate this question:
0
1
4
3
Rate this question:
The program has a runtime error because the last statement in the main method causes ArrayIndexOutOfBoundsException.
He program displays 0 1 2
The program displays 4.
The program has a compile error because i is not defined in the last statement in the main method.
Rate this question:
1 1 2 3 4 5
1 2 3 4 5 6
6 1 2 3 4 5
6 2 3 4 5 1
Rate this question:
2 3 4 5 6 1
1 2 3 4 5 6
2 3 4 5 6 1
1 1 1 1 1 1
Rate this question:
123
012
234
013
Rate this question:
The program displays 1 2 3 4
The program has a compile error on the statement x = new int[2], because x is final and cannot be changed.
The program displays 0 0
The elements in the array x cannot be changed, because x is final.
Rate this question:
The code has compile errors because the variable list cannot be changed once it is assigned.
The code can compile and run fine. The second line assigns a new array to list.
The code has compile errors because you cannot assign a different size array to list.
The code has runtime errors because the variable list cannot be changed once it is assigned.
Rate this question:
A copy of the array
The reference of the array
A copy of the first element
He length of the array
Rate this question:
Return int[]{1, 2, 3};
Return new int[]{1, 2, 3};
Return {1, 2, 3};
Return 1;
Rate this question:
654321
123456
234567
765432
Rate this question:
Ist1 is 3.1, 3.1, 2.5, 6.4
List1 is 2.5 3.1, 3.1, 6.4
List1 is 6.4, 3.1, 3.1, 2.5
List1 is 3.1, 2.5, 3.1, 6.4
Rate this question:
2
-1
2
4
Rate this question:
[1, 20, 30, 40, 50]
{1, 20, 30, 40, 50}
{1 20 30 40 50}
1 20 30 40 50]
Rate this question:
Args[0]
Args[2]
Args[3]
Args[1]
Rate this question:
Ow is 5 and high is 4
Ow is 3 and high is 6
Low is 0 and high is 6
Low is 6 and high is 5
True
False
Rate this question:
25
30
36
25
Rate this question:
3 & 2
2 and 1
2 and 2
3 and 3
Rate this question:
2,3,4
4,3,2
1,2,3
5,4,3
Rate this question:
True
False
Rate this question:
A[1][1]
A[0][0]
A[1][2]
A[3][4]
Rate this question:
1
33
3
5
Rate this question:
2 5 9 13
3 6 10 14
4 5 6 7
1 3 8 12
Rate this question:
Return new int[]{1, 2, 3};
Return new int[][]{{1, 2, 3}, {2, 4, 5}};
Return int[]{1, 2, 3};
Return {1, 2, 3};
Return 1;
Rate this question:
6 5 4
3 4 5
4 5 6
6 7 8
Rate this question:
Char[2][2][] charArray = {'a', 'b'};
Char[][][] charArray = new char[2][2][];
Char[][][] charArray = {{'a', 'b'}, {'c', 'd'}, {'e', 'f'}};
Char[][][] charArray = {{{'a', 'b'}, {'c', 'd'}, {'e', 'f'}}};
4
1
2
3
Rate this question:
4
3
8
6
Rate this question:
1
3
2
4
Rate this question:
The program has a compile error because the size of the array wasn't specified when declaring the array.
He program has a runtime error because the array element x[0] is not defined.
The program runs fine and displays x[0] is 0.
Rate this question:
Char[2] charArray = {'a', 'b'};
Char[] charArray = {'a', 'b'};
Char[] charArray = new char[]{'a', 'b'};
Char[] charArray = new char[2]; charArray = {'a', 'b'};
Rate this question:
Int[] i = {3, 4, 3, 2};
Int i = new int(30);
Double d[] = new double[30];
Char[] c = new char();
Rate this question:
The program displays 2.5, 3.0 4.0
The program displays 2.5 3.0 4.0
The program displays 2.5, 3, 4
The program has a syntax error because value is undefined.
Rate this question:
120 200 14
120 200 16
016 is a compile error. It should be written as 16.
120 200 20
Rate this question:
The program has a compile error because new int[2] is assigned to a.
He program has a runtime error because a[1] is not initialized.
The program displays a[1] is 0.
The program displays a[1] is 1.
Rate this question:
Public static void print(double... numbers, String name)
Public static void print(double... numbers)
Public static void print(int n, double... numbers)
Public static void print(String... strings, double... numbers)
Rate this question:
PrintMax(1, 2, 2, 1, 4);
PrintMax(new double[]{1, 2, 3});
PrintMax(1.0, 2.0, 2.0, 1.0, 4.0);
Option 4
Rate this question:
Low is 5 and high is 4
Low is 3 and high is 6
Low is 0 and high is 6
Low is 6 and high is 5
2.1, 3.1, 2.5, 6.4, 3.1
3.1, 3.1, 2.5, 2.1, 6.4
2.1, 2.5, 3.1, 3.1, 6.4
2.5, 3.1, 3.1, 6.4, 2.1
Rate this question:
Quiz Review Timeline (Updated): Mar 20, 2023 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.