Question: The output from the following code is _ _ _ _ _ _ _ _ _ _ . java.util.ArrayList list = new java.util.ArrayList ( )

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);
[New York, Atlanta]
[New York, Atlanta, Dallas]
[New York]
[New York, Dallas]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!