exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 52 discussion

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

You want to create a singleton class by using the Singleton design pattern.
Which two statements enforce the singleton nature of the design? (Choose two.)

  • A. Make the class static.
  • B. Make the constructor private.
  • C. Override equals() and hashCode() methods of the java.lang.Object class.
  • D. Use a public reference to point to the single instance.
  • E. Implement the Serializable interface.
  • F. Make the single instance created static and final.
Show Suggested Answer Hide Answer
Suggested Answer: BF 🗳️

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
6c84cb9
4 months ago
B. Make the constructor private. F. Make the single instance created static and final.
upvoted 1 times
...
6c84cb9
5 months, 1 week ago
B. Make the constructor private. Explanation: To ensure that a Singleton class has only one instance, its constructor should be private. This prevents anyone from creating new instances of the class from outside. F. Make the single instance created static and final. Explanation: To ensure that there is only one instance of a Singleton class, that instance should be declared as static and final. static means that the instance is shared by all objects of the class, and final means that it cannot be changed after it is created.
upvoted 1 times
...
asdfjhfgjuaDCV
10 months, 1 week ago
bf are correct
upvoted 1 times
...
steefaand
11 months, 2 weeks ago
Selected Answer: BF
B and F are correct.
upvoted 1 times
...
Kim514
1 year, 9 months ago
Answer is B, F. Eager initialization. https://www.digitalocean.com/community/tutorials/java-singleton-design-pattern-best-practices-examples
upvoted 1 times
...
r1muka5
1 year, 10 months ago
I think the answers are B and F here
upvoted 1 times
...
WilsonKKerll
2 years, 9 months ago
Answer is B, D. If D. Use a public reference to point to the single instance. change public to static.
upvoted 1 times
...
WilsonKKerll
2 years, 10 months ago
Answer is B, F.
upvoted 1 times
...
samtash1034
3 years ago
B and D
upvoted 3 times
...
AVB22
3 years, 2 months ago
B and F
upvoted 3 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