The JVM stores the array in an area of memory, called _______, which is used for dynamic memory allocation where blocks of memory are allocated and freed in an arbitrary order.
A. dynamic memory
B. stack
C. heap
D. memory block
查看答案
Do the following two programs produce the same result? Program I: public class Test {public static void main(String[] args) {int[] list = {1, 2, 3, 4, 5};reverse(list);for (int i = 0; i < list.length; i++)System.out.print(list[i] + " ");} public static void reverse(int[] list) {int[] newList = new int[list.length]; for (int i = 0; i < list.length; i++)newList[i] = list[list.length - 1 - i]; list = newList;} } Program II: public class Test {public static void main(String[] args) {int[] oldList = {1, 2, 3, 4, 5};reverse(oldList);for (int i = 0; i < oldList.length; i++)System.out.print(oldList[i] + " ");} public static void reverse(int[] list) {int[] newList = new int[list.length]; for (int i = 0; i < list.length; i++)newList[i] = list[list.length - 1 - i]; list = newList;} }
A. No
B. Yes
Given the following statementt[] list = new int[10];st.length has the value _______.
A. 9
B. 11
C. 10
D. The value depends on how many integers are stored in list.
The __________ method sorts the array scores of the double[] type.
A. java.util.Arrays(scores)
B. java.util.Arrays.sortArray(scores)
C. java.util.Arrays.sort(scores)
D. java.util.Arrays.sorts(scores)
Assume double[] scores = {1, 2, 3, 4, 5}, what value does java.util.Arrays.binarySearch(scores, 3.5) return?
A. -4
B. -3
C. 4
D. 3