Cyber Monday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Oracle Exam 1Z0-809 Topic 5 Question 67 Discussion

Actual exam question for Oracle's 1Z0-809 exam
Question #: 67
Topic #: 5
[All 1Z0-809 Questions]

Given the code fragments:

and

Which two modifications enable to sort the elements of the emps list? (Choose two.)

Show Suggested Answer Hide Answer
Suggested Answer: B, C

Contribute your Thoughts:

Kate
4 months ago
Haha, looks like we're sorting a list of people. I bet they all have names like 'John Smith' or 'Jane Doe'. Time to get creative with those names!
upvoted 0 times
Tien
3 months ago
Malissa: I agree! Let's come up with some unique names for the list of people we're sorting.
upvoted 0 times
...
Roselle
4 months ago
How about we get really creative with the names and make it more fun?
upvoted 0 times
...
Malissa
4 months ago
Yeah, and we should insert public int compare (Person p1, Person p2) {return p1.name.compareTo (p2.name); at line n2.
upvoted 0 times
...
Samira
4 months ago
I think we need to replace line n1 with class Person extends Comparator.
upvoted 0 times
...
...
Ceola
5 months ago
I agree with Wenona, options B and D make sense for sorting the elements.
upvoted 0 times
...
Kristofer
5 months ago
I agree with Shelia. Implementing the Comparable interface is the way to go here.
upvoted 0 times
Tuyet
4 months ago
C) Replace line n1 withclass Person implements Comparable
upvoted 0 times
...
Raelene
4 months ago
A) Replace line n1 withclass Person extends Comparator
upvoted 0 times
...
...
Wenona
5 months ago
But option B and D both involve comparing names, which is needed for sorting.
upvoted 0 times
...
Gregoria
5 months ago
I disagree, I believe option C and F are the right choices.
upvoted 0 times
...
Shelia
5 months ago
Option C is the correct answer. The Person class needs to implement the Comparable interface to sort the elements of the emps list.
upvoted 0 times
Mable
4 months ago
Great, so we need to choose option C and make that modification in the code.
upvoted 0 times
...
Tonette
4 months ago
That makes sense. It's important for sorting the elements of the emps list.
upvoted 0 times
...
Franklyn
4 months ago
Yes, you're right. The Person class needs to implement the Comparable interface.
upvoted 0 times
...
Twana
5 months ago
I think option C is the correct answer.
upvoted 0 times
...
...
Wenona
5 months ago
I think option B and D are the correct modifications.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77