1/42
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
When using a doubly-nested loop to process all of the elements of a two-dimensional array in row-major order, the outer loop will iterate over the rows.
True
When using a doubly-nested loop to process all of the elements of a two-dimensional array in column-major order, the outer loop will iterate over the columns.
True
When using a doubly-nested loop to process all of the elements of a two-dimensional array in column-major order, the outer loop will iterate over the rows.
False
The number of rows and columns in a two-dimensional array need not be the same.
True
The number of rows and columns in a two-dimensional array must be the same.
False
If a two-dimensional array has more rows than columns, then the array can still be processed in both row-major order and column-major order.
True
The declaration and allocation of a two-dimensional array need not be done in the same statement.
True
The declaration and allocation of a two-dimensional array must be done in the same statement.
False
In a two-dimensional array A, the number of columns is given by A[i].length, where i is an integer variable containing a valid row number.
True
In a two-dimensional array A, the number of rows is given by A.length.
True
The maximum number of dimensions that a Java array can have is theoretically unlimited, but implementations limit it to 255.
True
The row i of a 2D array of integers can be deleted with row[i] = new int[0].
True
The row i of a 2D array of integers cannot be deleted with row[i] = new int[0].
False
The row i of a 2D array of integers can be deleted with row[i].length = 0;
False
The row i of a 2D array of integers cannot be deleted with row\[i\].length = 0;
True
The updating section of a for loop may contain multiple statements separated by comma
True
An inner loop initialization and termination conditions may use the control variable of the outer loop
True
An outer loop can have any number of nested inner loop
True
Assuming 0<=pos1<=pos2<=A.length-1, the length of the array with elements pos1 to pos2 is pos2-pos1.
False
Assuming 0<=pos1<=pos2<=A.length-1, the length of the array with elements pos1 to pos2 is pos2-pos1+1.
True
The individual elements of an array A are indexed from 0 to A.length-1.
True
An array need not be always declared and allocated in the same Java statement
True
The number of elements in an array A can be accessed as A.length
True
The number of elements in an array A can be accessed as A\[0\].length
False
The base type of an array include int, double, boolean, char, and String.
True
The base type of an array can be int, double, boolean, char, but not String.
False
int\[\] a = {32, 16, 4, 91, 12}; // This both allocates the space for the array and initializes it
True
int\[\] A=new int\[10\]; A\[A.length-1\] = 100; would not cause an error (either compiler or run-time)
True
A\[-1\] accesses the last element of the array A
False
A\[-1\] cannot access the last element of the array A
True
A\[A.length-1\] cannot access the last element of the array A
False
One cannot enlarge the array A by 1 using A.length++;
True
One can enlarge the array A by 1 using A.length++;
False
One cannot free a array A from memory by setting its length to zero with A.length=0;
True
The following code would generate an error attempting to set the length of array A to 10: int\[\] A; A\[9\]=0;
True
The following code sets the length of array A to 10: int\[\] A; A=new int\[10\]; A\[9\]=0;
True
The following code would generate an error attempting to set the length of array A to 10: int\[\] A; A=new int\[10\]; A\[9\]=0;
False
int\[\] A; A\[0\]=0; would generate an error attempting to create an array with the first element set to 0;
True
int\[\] A does not create an array with space already allocated, like int A\[\].
True
int\[\] A create an array with space already allocated, unlike int A\[\].
False
int a\[\],b,c; creates an array a and two integer variables b and c.
True
int\[\] a,b\[\],c\[\]; is equivalent with: int a\[\], b\[\],c\[\];
False
int\[\] a,b\[\],c\[\]; is equivalent with: int a\[\], b\[\]\[\],c\[\]\[\];
True