Consider the following program written in Java and answer the question:
1. import java.util.*;
2. class Arraylist
3. {
4. public static void main(String args[])
5. {
6. ArrayList obj = new ArrayList();
7. obj.add("B");
8. obj.add("C");
9. obj.add("C");
10. obj.add("D");
11. obj.remove(2);
12. System.out.println(obj.get(1));
13. }
14. }
What would be the output of the statement when the program is executed?
The output of the statement when the program is executed
Comments
Leave a comment