exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 75 discussion

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

Given:



Which change would make Foo more secure?

  • A. public String beta = "beta";
  • B. public static final String ALPHA = "alpha";
  • C. private String delta;
  • D. protected final String beta = "beta";
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
ASPushkin
6 months, 3 weeks ago
answer: B make more secure because of final attribute C failed it can be changed without final attribute D failed the value can be changed A failed make less secure because of public access
upvoted 1 times
...
d7bb0b2
1 year, 1 month ago
The correct answer is D. protected final String beta = "beta"; Making the beta field final would prevent it from being modified after it is initialized, which can make the class more secure by ensuring that the beta field cannot be changed after the object is constructed. Changing the access modifier to protected would restrict access to the beta field to classes in the same package and subclasses, which can also improve security by limiting the code that can access the field.
upvoted 1 times
...
[Removed]
1 year, 4 months ago
Selected Answer: B
In the original code it is possible to set the ALPHA-static variable before calling the foo()-method by Foo.ALPHA = "xxxx"; To make it more secure you should make this variable final so that an outside program cannot modify it.
upvoted 1 times
...
Stavok
1 year, 6 months ago
Selected Answer: C
The change that would make the Foo class more secure is option C. private String delta. This would restrict access to the delta variable to only within the Foo class, making it more secure.
upvoted 1 times
...
Adel2023
1 year, 8 months ago
Selected Answer: B
must be a static final variable
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