Exam Name: | Java SE 8 Programmer II | ||
Exam Code: | 1z0-809 Dumps | ||
Vendor: | Oracle | Certification: | Java SE |
Questions: | 208 Q&A's | Shared By: | zayne |
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
List
Guide to Java Tour”, 3));
Collections.sort(books, new Book());
System.out.print(books);
What is the result?
Given the code fragment:
List
List
//line n1
Which code fragment, when inserted at line n1, prints 10 20 15 30?
Given the code fragment:
List
Function
nL.Stream()
.map(funVal)
.peek(System.out::print);
What is the result?