exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 109 discussion

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

Given:



To secure this code, you want to make sure that the client code cannot modify the public static fields.

Which code will accomplish this?

  • A.
  • B.
  • C.
  • D.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
TheOneAboveAll
8 months, 2 weeks ago
Selected Answer: C
interface -> variable final static
upvoted 1 times
...
Stavok
11 months, 1 week ago
Selected Answer: C
The correct answer is C. By defining the fields in an interface, you can make sure that the client code cannot modify them. In an interface, all fields are implicitly public, static, and final, so their values cannot be changed once they are initialized.
upvoted 2 times
...
KiraguJohn
11 months, 3 weeks ago
C In Java, interface variables are implicitly considered as constants and are therefore effectively final. By default, all variables declared in an interface are implicitly marked as public, static, and final, regardless of whether the public, static, or final modifiers are explicitly specified.
upvoted 4 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 ...