csc chapter 7 quiz
By default, Java initializes array elements with what value?
0
What would be the results of the following code?
Value contains the lowest value in array1.
A sorting algorithm is used to locate a specific item in a larger collection of data.
false
An array can hold multiple values of several different data types simultaneously
false
If a[] and b[] are two integer arrays, the expression a == b compares the array contents.
false
It is common practice to use a ________ variable as a size declarator.
final
In Java, you do not use the new operator when you use a(n):
initialization list
A search algorithm:
is a way to locate a specific item in a larger collection of data
Each array in Java has a public field named ________ that contains the number of elements in the array.
length
What do you call the number that is used as an index to pinpoint a specific element within an array?
subscript
This indicates the number of elements, or values, the array can hold.
the arrays size declarator
A sorting algorithm is a technique for scanning through an array and rearranging its contents in some specific order.
true
Declaring an array reference variable does not create an array.
true
Once an array is created, its size cannot be changed.
true
To compare the contents of two arrays, you must compare the elements of the two arrays.
true
The sequential search algorithm:
uses a loop to sequentially step through an array, starting with the first element requires the array to be ordered
The binary search algorithm:
will cut the portion of the array being searched in half each time
Subscript numbering always starts at what value?
0
If final int SIZE = 15 and int[] x = new int[SIZE], what would be the range of subscript values that could be used with x[]?
0 through 14
Java performs ________, which means that it does not allow a statement to use a subscript that is outside the range of valid subscripts for the array.
array bounds checking