Given the code fragments:
and
What is the result?
Given:
Which two interfaces can you use to create lambda expressions? (Choose two.)
Given the code fragment:
Which statement can be inserted into line n1 to print 1,2; 1,10; 2,20;?
Given the code fragments:
interface CourseFilter extends Predicate
public default boolean test (String str) {
return str.contains (“Java”);
}
}
and
List
Predicate
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?