sort逆序(char String)

时间:2021-03-10 23:59:14
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class Main { public static void main(String[] args) {
Scanner in =new Scanner (System.in);
String[] a=new String[10];
for(int i=0;i<10;i++)
a[i]=in.next();
Arrays.sort(a,Collections.reverseOrder());
for(String m:a) {
System.out.println(m);
}
}
}