Suppose ArrayList x contains two strings [Beijing, Singapore]. Which of the following methods will cause the list to become [Beijing, Chicago, Singapore]?

Suppose ArrayList x contains two strings [Beijing, Singapore]. Which of the following methods will cause the list to become [Beijing, Chicago, Singapore]?


A. x.add("Chicago")
B. x.add(0, "Chicago")
C. x.add(1, "Chicago")
D. x.add(2, "Chicago")

The correct answer is C


Java

Learn More Multiple Choice Question :