exam questions

Exam 1z0-829 All Questions

View all questions & answers for the 1z0-829 exam

Exam 1z0-829 topic 1 question 48 discussion

Actual exam question from Oracle's 1z0-829
Question #: 48
Topic #: 1
[All 1z0-829 Questions]

Given the code fragment:

Which action sorts the book list?

  • A. At Line n2, replace books.sort() with books.stream().sort().
  • B. At Line n1, convert books type to mutable ArrayList type.
  • C. At Line n2, replace compareTo() with compare().
  • D. At Line n1, convert books type to mutable array type.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
SrinivasJasti
2 weeks, 1 day ago
Selected Answer: B
Since List.of() creates an immutable list, changing it to a mutable list -->. List<Book> books = new ArrayList<>(List.of( new Book("A1", "T1"), new Book("A2", "T2"), new Book("A1", "T2") ));
upvoted 1 times
...
xplorerpj
6 months, 3 weeks ago
Selected Answer: B
B is correct answer. List is immutable
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago