这是排序ArrayList的正确方法吗? 问题是该列表未被排序。这是正确的排序方法吗?
out = new StringTokenizer(input.toString());
n = (out.countTokens());
for (int i = 0; i < n; i++) {
String[] words = { out.nextToken().toString() };
final List<String> wordList = Arrays.asList(words);
Collections.sort(wordList);
System.out.println(wordList.toString());
}
为什么不把这种排序移到循环之外? – Maroun 2013-04-07 13:10:15
@Maroun Maroun By alphabyte – antoxa2584 2013-04-07 13:11:45