The output from the following code is __________.

```
java.util.ArrayList list = new java.util.ArrayList();
list.add("New York");
java.util.ArrayList list1 = (java.util.ArrayList)(list.clone());
list.add("Atlanta");
list1.add("Dallas");
System.out.println(list1);
```
a. [New York]
b. [New York, Atlanta]
c. [New York, Atlanta, Dallas]
d. [New York, Dallas]

d. [New York, Dallas]
The code added New York to list and cloned list1 from list. list1 now contains New York. Dallas is added to list1. So list1 contains New Your and Dallas.

Computer Science & Information Technology

You might also like to view...

Which of the following is false?

a. An entire non-char array cannot be input or output at once. b. Two arrays cannot be meaningfully compared with equality or relational operators. c. Arrays cannot be assigned to one another (i.e., array1 = array2;). d. C++ ensures that you cannot “walk off” either end of an array.

Computer Science & Information Technology

Which of the following buttons should you click to open the Insert Hyperlink dialog box?

A.
B.
C.
D.

Computer Science & Information Technology