这就是我所拥有的
ArrayList <String> cdList = new ArrayList();
Collections.addAll(cdList, "ExampleA\n"+"ExampleB\n"+"ExampleC\n"+"ExampleD");
Collections.sort(cdList, String.CASE_INSENSITIVE_ORDER);
System.out.println(cdList);
bigBox.setText("Original Order\n**************\n");
for (int i = 0; i < cdList.size(); i++) {
bigBox.setText(bigBox.getText()+""+cdList.get(i)+"\n");
}
bigBox.setText(bigBox.getText()+"\n\nSorted Order\n************\n");
Collections.sort(cdList);
for (int j = 0; j < cdList.size(); j++) {
bigBox.setText(bigBox.getText()+""+);
}
我希望按原始顺序和字母顺序输出 4 个示例。我究竟做错了什么?