List <String> cdList = new ArrayList();
Collections.addAll(cdList, "ExampleG","ExampleB","ExampleR","ExampleX");
bigBox.append("Original Order\n**************\n");
for (String s : cdList) {
bigBox.append(s);
bigBox.append("\n");
}
bigBox.append("\n\nSorted Order\n************\n");
for (String s : cdList) {
bigBox.append(s);
bigBox.append("\n");
}
我需要按字母顺序组织列表,并使其显示在“排序顺序”下方,但还需要保留原始订单以在原始订单行下使用。