Private constructors are used to prevent creating instances of a class when there are no instance fields or methods , such as the Math class, or when a method is called to obtain an instance of a class.
What is the purpose of a private constructor?
Private constructors are used to prevent creating instances of a class when there are no instance fields or methods , such as the Math class, or when a method is called to obtain an instance of a class.