Question 87 of 130 from exam 1Z0-809: Java SE 8 Programmer II

Question 87 of 130 from exam 1Z0-809: Java SE 8 Programmer II

Question

Given:

class Product {
String name;
int qty?
public String toString(){
return name;
?
public Product (String name, int qty) {
this.name = name;
this.qty = qty;
)
static class ProductPilter {
public boolean isAvailable(Product p) { // line ni
return p.gty >= 10;
}
List<Product> products = Arrays.asList (
new Product ("MotherBoard", 5),
new Product ("Speaker", 20));7

products.stream()
-filter (Product .ProductFilter::isAvailable) // line n2
-forEach(p -> System.out.print1n(p));

Which modification enables the code fragment to print Speaker?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B.