Reverse sorting

Report a typo

Implement a method that takes a List<String> and sorts it in reverse lexicographic order. You don't need to read or write anything from or to the console, just implement the method.

Sample Input 1:

apple grape pear banana pineapple

Sample Output 1:

pineapple pear grape banana apple

Sample Input 2:

Cap cape cup cake Cook

Sample Output 2:

cup cape cake Cook Cap
Write a program in Java 17
import java.util.List;

class Utils {

public static void sortStrings(List<String> strings) {
// your code here
}
}
___

Create a free account to access the full topic