Given the code fragments:
interface CourseFilter extends Predicate<String> {
public default boolean test (String str) {
return str.equals ("Java");
}
}
and
List<String> strs = Arrays.asList("Java", "Java EE", "Java ME");
Predicate<String> cf1 = s - > s.length() > 3;
Predicate cf2 = new CourseFilter() { //line n1
public boolean test (String s) {
return s.contains ("Java");
}
};
long c = strs.stream()
.filter(cf1)
.filter(cf2 //line n2
.count();
System.out.println(c);
What is the result?
Ritesh_
Highly Voted 4 years, 9 months agoadnano1234
Highly Voted 4 years, 6 months agoasdfjhfgjuaDCV
Most Recent 4 months, 4 weeks agoasdfjhfgjuaDCV
4 months, 4 weeks agosteefaand
5 months, 4 weeks agor1muka5
1 year, 5 months agoGaelBernard
11 months, 3 weeks agoDangNHH
1 year, 4 months agoMudzingwa
1 year, 10 months agoWilsonKKerll
2 years, 4 months agoInnovation
4 years, 6 months ago