我不知道如何打印我的新列表
import java.util.ArrayList;
import java.util.List;
public class InsertionSort {
public static int insertion(List<String> sorted) {
sorted = new ArrayList<String>();
String list[] = {"Banana","Pear","Apple","Peach","Orange"};
String temp="";
int f = list.length;
for(int i=0;i<f;i++){
for(int j=i+1;j<f;j++){
if(list[i].compareToIgnoreCase(list[j])>0){
temp = list[i];
list[i]=list[j];
list[j]=temp;
}
}
}
System.out.print(list);
return list[].InsertionSort;
对于上面的行,我不断收到此错误 1 发现错误: InsertionSort.java [line: 22] Error: class expected
}
}