← Quiz: Java Interview Questions: all 10 questions
Quiz: Java Interview Questions · Question 3 of 10
Which is used to implement the Singleton pattern?
Which is used to implement the Singleton pattern?
- A.A public constructor
- B.A private constructor with a static instance
- C.An abstract class
- D.A final method
Answer & explanation
Correct answer: A private constructor with a static instance
A private constructor prevents outside creation; a static method returns the single instance.
Can you get the rest right without peeking?
Take the timed Quiz: Java Interview Questions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →