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 5 years, 2 months agoadnano1234
Highly Voted 4 years, 11 months agoasdfjhfgjuaDCV
Most Recent 9 months, 4 weeks agoasdfjhfgjuaDCV
9 months, 4 weeks agosteefaand
10 months, 3 weeks agor1muka5
1 year, 10 months agoGaelBernard
1 year, 4 months agoDangNHH
1 year, 9 months agoMudzingwa
2 years, 2 months agoWilsonKKerll
2 years, 9 months agoInnovation
4 years, 11 months ago