java 8 Collector<String, A, R> is not a functional interface, who can tell why?
The follow code : public class Test { public static void main(String[] args) { Stream.of(1,2,3).map(String::valueOf).collect(Collectors::toList) } } intellij tell me : Collector<String, A, R> is not a functional interface but when i modify the code as follows, everything is ok, i don't know why? public class Test { public static void main(String[] args) { Stream.of(1,2,3).map(String::valueOf).collect(Collectors.<String>toList) } } The reason that the first syntax is illegal is that the target type implied by the method signature— Stream.collect(Collector) —is a Collector . Collector has