Dealing with Singletons which have to subclass

后端 未结 3 1175
攒了一身酷
攒了一身酷 2021-02-14 07:10

In the question What is an efficient way to implement a singleton pattern in Java? the answer with the most upvotes says, to use a Enum for implementing a singleton.

Tha

3条回答
  •  花落未央
    2021-02-14 08:07

    Josh is referring to extending the enum type, not to having the singleton type extend something else.

提交回复
热议问题