---
title: "Private constructors can be used in the singleton design pattern"  
description: "Private constructors can be used in the singleton design pattern"  
author: "Anonymous User"  
published: 2015-02-23  
updated: 2020-09-14  
canonical: https://www.mindstick.com/interview/2338/private-constructors-can-be-used-in-the-singleton-design-pattern  
category: "asp.net mvc"  
tags: ["java", "oops"]  
reading_time: 2 minutes  

---

# Private constructors can be used in the singleton design pattern

Why would you want objects of your class to only be created internally? This could be done for any reason, but one possible reason is that you want to implement a singleton. A **singleton** is a design pattern that allows only one instance of your class to be created, and this can be accomplished by using a private constructor.The singleton pattern is one of the simplest design patterns: it involves only one class which is responsible to instantiate itself, to make sure it creates not more than one instance; in the same time it provides a global point of access to that instance.

## Answers

### Answer by Anonymous User

Why would you want objects of your class to only be created internally? This could be done for any reason, but one possible reason is that you want to implement a singleton. A **singleton** is a design pattern that allows only one instance of your class to be created, and this can be accomplished by using a private constructor.The singleton pattern is one of the simplest design patterns: it involves only one class which is responsible to instantiate itself, to make sure it creates not more than one instance; in the same time it provides a global point of access to that instance.


---

Original Source: https://www.mindstick.com/interview/2338/private-constructors-can-be-used-in-the-singleton-design-pattern

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
