Oracle 1z0-809 Question Answer
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?
Oracle 1z0-809 Summary
- Vendor: Oracle
- Product: 1z0-809
- Update on: Jul 25, 2025
- Questions: 196