MCQs>IT & Programming>JSharp - J#>Consider the following program: import java.util.*; public class ListColl { public static void main(String str[]) { List l = new ArrayList(); l.add('1'); l.add('2'); l.add(1,'3'); List l2 = new LinkedList(l); l.addAll(l2); System.out.println(l); } } Which of the following sequences will be printed when the above program is run?
JSharp - J# MCQs
Consider the following program: import java.util.*; public class ListColl { public static void main(String str[]) { List l = new ArrayList(); l.add("1"); l.add("2"); l.add(1,"3"); List l2 = new LinkedList(l); l.addAll(l2);
System.out.println(l); } }
Which of the following sequences will be printed when the above program is run?
Answer
Correct Answer: [1, 3, 2, 1, 3, 2]
Explanation:
Note: This Question is unanswered, help us to find answer for this one