String[] words = { ... };List<String> list = new ArrayList<String>(words.length);for (String s : words) { list.add(s);}
是这样的吗,把字符串数组转成字符串集合String[] words = {"a","b","c","d","e"}; List<String> list = Arrays.asList(words); for (int i = 0; i < list.size(); i++) { System.out.println(list.get(i)); }//顺便一说,定义list的时候你也可以不指定长度的,变长的,随时添加移除都行的