Question 22
Consider the code given below.
import java.util.*;public class ListExample { public static void main(String[] args) { _____________________________ //LINE 1 _____________________________ //LINE 2 list1 = new ArrayList<String>(); list1.add("India"); list1.add("Hyderabad"); list2 = new LinkedList<String>(list1); for(String s : list1) System.out.println(s); for(String s : list2) System.out.println(s); }}If the code given above produces the output:
India
Hyderabad
India
Hyderabad
What should be the correct choice for LINE 1 and LINE 2?