maccaudill02
maccaudill02
02.11.2019 • 
Engineering

Analyze the following code:

double [] array = {1,2,3};
arraylistlist = new arraylist< > (arrays aslist(array));
system.out.printin(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.

Solved
Show answers

Ask an AI advisor a question