What are the functions of constructor privatization and clone privatization
风行2018-11-26 17:19:08
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