Main.java:15: error: incompatible types: void cannot be converted to Comparable
Comparable c=Collections.reverse(x);
^
Main.java:16: error: no suitable method found for sort(List<String>,Comparable)
Collections.sort(x,c);
^
method Collections.<T#1>sort(List<T#1>) is not applicable
(cannot infer type-variable(s) T#1
(actual and formal argument lists differ in length))
method Collections.<T#2>sort(List<T#2>,Comparator<? super T#2>) is not applicable
(cannot infer type-variable(s) T#2
(argument mismatch; Comparable cannot be converted to Comparator<? super T#2>))
where T#1,T#2 are type-variables:
T#1 extends Comparable<? super T#1> declared in method <T#1>sort(List<T#1>)
T#2 extends Object declared in method <T#2>sort(List<T#2>,Comparator<? super T#2>)
Main.java:20: error: variable c is already defined in method main(String[])
Comparable c=Collections.reverseOrder(x);
^
Main.java:20: error: no suitable method found for reverseOrder(List<String>)
Comparable c=Collections.reverseOrder(x);
^
method Collections.<T#1>reverseOrder() is not applicable
(cannot infer type-variable(s) T#1
(actual and formal argument lists differ in length))
method Collections.<T#2>reverseOrder(Comparator<T#2>) is not applicable
(cannot infer type-variable(s) T#2
(argument mismatch; List<String> cannot be converted to Comparator<T#2>))
where T#1,T#2 are type-variables:
T#1 extends Object declared in method <T#1>reverseOrder()
T#2 extends Object declared in method <T#2>reverseOrder(Comparator<T#2>)
Main.java:21: error: no suitable method found for sort(List<String>,Comparable)
Collections.sort(x,c);
^
method Collections.<T#1>sort(List<T#1>) is not applicable
(cannot infer type-variable(s) T#1
(actual and formal argument lists differ in length))
method Collections.<T#2>sort(List<T#2>,Comparator<? super T#2>) is not applicable
(cannot infer type-variable(s) T#2
(argument mismatch; Comparable cannot be converted to Comparator<? super T#2>))
where T#1,T#2 are type-variables:
T#1 extends Comparable<? super T#1> declared in method <T#1>sort(List<T#1>)
T#2 extends Object declared in method <T#2>sort(List<T#2>,Comparator<? super T#2>)
5 errors