LearnFrenzy
Sign in Take a free test

Constructors and the this Keyword · Constructors MCQ · Question 10

Uses of a private constructor Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links