多选题
What is the output of the following code segment?
ArrayList <String> sampleArrayList = new ArrayList <String>();
sampleArrayList.add ("One");
sampleArrayList.add
("Two");
sampleArrayList.add (1, "Three");
for(String s : sampleArrayList) {
System.out.print(s+"
");
}
- A. One Two Three
- B. One Three Two
- C. Three One Two
- D. One Three
- E. Three Two
- F. A compile time error will be generated.
- G. A runtime exception will be thrown.