I have no idea how to get my new list to print
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;
I keep getting this error for the line above 1 error found: InsertionSort.java [line: 22] Error: class expected
}
}