I will be happy if someone can explain why I can not compare String in an array using the Stream API in Java.
I am trying to filter only the pairs when the first word is before the second lexicographically.
String[] input = { "Apple", "Banana" };
Arrays.stream(input)
.filter( (a,b)-> a.compareTo(b)< 0 )
It seems that Java doesn't understand, that "b" is a String, but why?