file:///C|/Users/usuller/Downloads/chapter11.txt[12/4/2019 3:47:54 PM]
Double[] array = {1, 2, 3};
ArrayList<Double> list = new ArrayList<>(Arrays.asList(array));
System.out.println(list);
a. The code is correct and displays [1, 2, 3].
b. The code is correct and displays [1.0, 2.0, 3.0].
c. The code has a compile error because an integer such as 1 is automatically converted into an Integer object, but
the array element type is Double.
d. The code has a compile error because asList(array) requires that the array elements are objects.
#
53. Analyze the following code:
double[] array = {1, 2, 3};
ArrayList<Double> list = new ArrayList<>(Arrays.asList(array));
System.out.println(list);
a. The code is correct and displays [1, 2, 3].
b. The code is correct and displays [1.0, 2.0, 3.0].
c. The code has a compile error because an integer such as 1 is automatically converted into an Integer object, but
the array element type is Double.
d. The code has a compile error because asList(array) requires that the array elements are objects.
#
54. Analyze the following code:
double[] c = {1, 2, 3};
System.out.println(java.util.Collections.max(c));
a. The code is correct and displays 3.
b. The code is correct and displays 3.0.
c. The code has a compile error on Collections.max(c). c cannot be an array.
d. The code has a compile error on double[] c = {1, 2, 3}.
#
55. Analyze the following code:
Integer[] c = {3, 5};
java.util.Collections.shuffle(c);
System.out.println(java.util.Arrays.toString(c));
a. The code is correct and displays [3, 5].
b. The code is correct and displays [5, 3].
c. The code has a compile error on Collections.shuffle(c). c cannot be an array.
d. The code has a compile error on Integer[] c = {3, 5}.
#
Section 11.14 The protected Data and Methods
59. A class design requires that a particular member variable must be accessible by any subclasses of this class, but