The singleton pattern is recommended to be implemented by using static inner classes

   

        The singleton mode is recommended to be implemented as a static inner class. For details, please refer to: Java Memory Model FAQ (11) Does the new memory model fix the double lock check problem?

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326070552&siteId=291194637