exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 152 discussion

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

Given the code fragment:



What is the output?

  • A. A runtime exception is thrown.
  • B. The compilation fails.
  • C. [-3, -2, -l]
  • D. [-1, -2, -3]
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
ASPushkin
5 months ago
Selected Answer: A
- The List.of and List.copyOf static factory methods provide a convenient way to create unmodifiable lists. The List instances created by these methods have the following characteristics: - They are unmodifiable. Elements cannot be added, removed, or replaced. Calling any mutator method on the List will always cause runtime UnsupportedOperationException to be thrown. However, if the contained elements are themselves mutable, this may cause the List's contents to appear to change public class UnsupportedOperationException extends RuntimeException
upvoted 1 times
...
Stavok
1 year ago
Selected Answer: A
A is correct
upvoted 1 times
...
KiraguJohn
1 year ago
A because List.of(...) is an immutable list you can't modify
upvoted 2 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