Question 10
Back to Exercise
Which is a typical use of a private constructor?
- A Making fields private
- B Preventing outside code from creating objects – for utility classes, singletons, or creation through factory methods and builders Correct
- C Speeding up construction
- D Allowing inheritance
Correct Answer: Option B
Math and Collections have private constructors.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!