Dealing with Singletons which have to subclass

后端 未结 3 705
栀梦
栀梦 2021-02-14 07:26

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:01

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

提交回复
热议问题