Given the code fragments:
interface CourseFilter extends Predicate<String> {
public default boolean test (String str) {
return str.contains ("Java");
}
}
and
List<String> strs = Arrays.asList("Java", "Java EE", "Embedded Java");
Predicate<String> cf1 = s - > s.length() > 3;
Predicate cf2 = new CourseFilter() { //line n1
public boolean test (String s) {
return s.startsWith ("Java");
}
};
long c = strs.stream()
.filter(cf1)
.filter(cf2 //line n2
.count();
System.out.println(c);
What is the result?
Huim
Highly Voted 3 years, 2 months agovancuver
2 years, 11 months agosteefaand
Most Recent 5 months, 4 weeks agoduydn
10 months, 2 weeks agoWilsonKKerll
2 years, 4 months agoSvetleto13
3 years, 2 months agomaslac
3 years, 3 months agoMilkBiscuit
3 years, 7 months agomevlt
2 years, 5 months ago