This is about the design pattern. The singleton pattern can only produce one object. The privatized constructor is to prevent the new class of external programs from losing the meaning of the singleton mode , and the cloning privatization prevents users from copying object instances
This is about the design pattern. The singleton pattern can only produce one object. The privatized constructor is to prevent the new class of external programs from losing the meaning of the singleton mode
, and the cloning privatization prevents users from copying object instances