Question: What is wrong with the following code? List 1 = new ArrayList ( ) ; List 1 2 = new ArrayList ( ) ; l

What is wrong with the following code?
List 1= new ArrayList();
List 12= new ArrayList();
l.add("Hello");
l.add("World");
Collections.copy(12, I);
I2 is not the same size as I
There is nothing wrong with this code
12 holds strings and 11 holds ints
I is a List and I2 is an ArrayList
Question 3
 What is wrong with the following code? List 1= new ArrayList();

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!