exam questions

Exam 1z0-809 All Questions

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

Exam 1z0-809 topic 1 question 114 discussion

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

Which two are elements of a singleton class? (Choose two.)

  • A. a transient reference to point to the single instance
  • B. a public method to instantiate the single instance
  • C. a public static method to return a copy of the singleton reference
  • D. a private constructor to the class
  • E. a public reference to point to the single instance
Show Suggested Answer Hide Answer
Suggested Answer: CD 🗳️

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
JME_CHG
Highly Voted 3 years, 10 months ago
C,D, not B otherwise could keep calling that public method and instantiate multiple times
upvoted 16 times
...
vidhuharu
Most Recent 3 months, 1 week ago
Selected Answer: BD
Band D. it needs the public method not public static . public static method always returns a copy of it.
upvoted 1 times
...
steefaand
11 months, 2 weeks ago
Selected Answer: CD
C and D are correct since we need static method to return instance of singleton and private constructor so that it is not possible to create multiple instances.
upvoted 1 times
...
lchowen
2 years, 3 months ago
Considering the standard Singleton implementation (i.e. the Bill Pugh implementation) : public class BillPughSingleton { private BillPughSingleton(){} private static class SingletonHelper{ private static final BillPughSingleton INSTANCE = new BillPughSingleton(); } public static BillPughSingleton getInstance(){ return SingletonHelper.INSTANCE; } } We can conclude that answer is CD
upvoted 2 times
...
karta
2 years, 5 months ago
Selected Answer: CD
anser is C D
upvoted 2 times
...
Ohayou
2 years, 10 months ago
Answer : CD
upvoted 1 times
...
WilsonKKerll
2 years, 10 months ago
Selected Answer: CD
public class SingletonGreed { private static SingletonGreed instance = new SingletonGreed(); private SingletonGreed(){} public static SingletonGreed getInstance () { return instance; } }
upvoted 3 times
...
mevlt
2 years, 10 months ago
Selected Answer: BD
it is BD because constructor has to be private to prevent instantiation and also there must be a method to check if there is already an object of it to provide otherwise create a new one.
upvoted 1 times
...
petetsai
3 years ago
Selected Answer: DE
D E~~~!!!
upvoted 1 times
...
Svetleto13
3 years, 8 months ago
C,D checked.
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