我正在尝试读取字符串并对它们进行排序。我收到了很多错误,这些错误在下面的代码中加了星号。你能告诉我如何解决这些错误吗?
package hw05;
/*
Demonstrates selectionSort on an array of strings.
*/
import java.util.Scanner;
public class Strings {
// --------------------------------------------
// Reads in an array of strings, sorts them,
// then prints them in sorted order.
// --------------------------------------------
public static void main(String[] args) {
String[] stringList;
String size;
Scanner scan = new Scanner(System.in);
System.out.print("\nHow many strings do you want to sort? ");
size = scan.nextLine();
**stringList = new String[size];**
System.out.println("\nEnter the strings...");
**for (String i = 0; i < size; i++)
stringList[i] = scan.nextLine();**
Sorting.selectionSort(stringList);
System.out.println("\nYour strings in sorted order...");
**for (String i = 0; i < size; i++)
System.out.print(stringList[i] + " ");**
System.out.println();
}
}