functional programming - Why can't I Implement Streams functionality in my JAVA project? -
i'm beginner of java programming. recently, tried use map
& filter
functionality of stream
s following code shows.
list<string> strlist = arrays.aslist("abc", "", "bcd", "", "defg", "jk"); long count = strlist.stream().filter(x -> x.isempty()).count(); system.out.printf("list %s has %d empty strings %n", strlist, count);
however, compiler complains need "create local variable x".
maybe lose basic steps easy find related discussions on google.
my java compiler version j2se 1.5, , import java.util.stream.* file.
thanks!
stream
s , lambda expressions java 8 functionality. upgrade compiler.
Comments
Post a Comment