My question may be unclear so let me clear it out by example:
Arrays.sort(arr, new Comparator<String>(){
public int compare(String a, String b){
return (b + a).compareTo(a + b);
}
});
I want to use the Comparator.comparing. I tried out the following:
Arrays.sort(arr, Comparator.comparing((a, b) -> (b + a).compareTo((String)a + b)));
I get an error - bad return type in lamdba expression. How to fix this ?