Q. Why is constructor private?

  • (A) To restrict usage
  • (B) To enforce static factory methods
  • (C) To improve performance
  • (D) To avoid inheritance
πŸ’¬ Discuss
βœ… Correct Answer: (B) To enforce static factory methods
Explanation: Ensures creation via json() or other static methods.
Explanation by: Roshan
Ensures creation via json() or other static methods.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
12
Total Visits
πŸ“½οΈ
2 mo ago
Published
πŸŽ–οΈ
Roshan
Publisher
πŸ“ˆ
91%
Success Rate