我有2个String
阵列
String[] question1 = {"Q1","Q2","Q3","Q4"};
String[] question2 = {"Q5","Q6","Q7","Q8"};
一个ArrayList
ArrayList<String> aList = new ArrayList<String>();
如果我想访问ArrayList
的成员,我该如何操作它们。我尝试将两个数组转换为String,但它没有提供解决方案。
答案 0 :(得分:21)
ArrayList<String> aList = new ArrayList<String>(Arrays.asList(question1));
aList.addAll(Arrays.asList(question2));