Question:Which sequence will be printed when the following program is run?
import java.util.*;

public class Test {

 public static void main(String str[]) {

  List l = new ArrayList();
  l.add(''1'');
  l.add(''2'');
  l.add(1,''3'');
  System.out.println(l);
 }
}
 

A [1, 3, 2] 

B [1, 3, 1] 

C [1, 1, 3] 

D [1, 1, 2] 

E This code will generate an error. 

+ Answer
+ Report
Total Preview: 612

Copyright © 2024. Powered by Intellect Software Ltd