1Z0-809 Dumps

1Z0-809 Free Practice Test

Oracle 1Z0-809: Java SE 8 Programmer II

QUESTION 56

Given the code fragment:
List colors = Arrays.asList(“red”, “green”, “yellow”); Predicate test = n - > { System.out.println(“Searching…”);
return n.contains(“red”);
};
colors.stream()
.f ilter(c -> c.length() > 3)
.allMatch(test); What is the result?

Correct Answer: A

QUESTION 57

Given the definition of the Book class:
<>

Correct Answer: A

QUESTION 58

Given:
< ><>>< ><>

Correct Answer: C

QUESTION 59

Which two statements are true about synchronization and locks? (Choose two.)

Correct Answer: AB

QUESTION 60

Given the code fragments:
public class Book implements Comparator { String name;
double price; public Book () {}
public Book(String name, double price) { this.name = name;
this.price = price;
}
public int compare(Book b1, Book b2) { return b1.name.compareTo(b2.name);
}
public String toString() { return name + “:” + price;
}
}
and
Listbooks = Arrays.asList (new Book (“Beginning with Java”, 2), new book (“A
Guide to Java Tour”, 3));
Collections.sort(books, new Book()); System.out.print(books);
What is the result?

Correct Answer: A