多选题 Given:
1. import java.util.*;
2. public class Elway {
3. public static void main(String[] args) {
4. ArrayList[] ls = new ArrayList[3];
5. for(int i = 0; i < 3; i++) {
6. ls[i] = new ArrayList();
7. ls[i].add("a" + i);
8. }
9. Object o = ls;
10. do3(ls) ;
11. for(int i = 0; i < 3; i++) {
12. // insert code here
13. }
14. }
15. static Object do3(ArrayList[] a) {
16. for(int i = 0; i < 3; i++) a[i] .add("e");
17. return a;
18. } }
And the following fragments:
Ⅰ. System.out.print (o [i ] + " ");
Ⅱ. System.out.print((ArrayList[]) [i] + " ");
Ⅲ. System.out.print( ((Object[])o) [i] + " ");
Ⅳ. System.out.print(((ArrayList[])o) [i] + " ");
If the fragments are added to line 12, independently, which are true? (Choose all that apply.)
【正确答案】 C、D、G
【答案解析】