Java Singleton Pattern

后端 未结 8 1889
难免孤独
难免孤独 2020-12-03 05:22

Edit: Answered - error was method wasn\'t static

I\'m used the Singleton Design Pattern

 public class Singleton {
   private static final Singleton I         


        
8条回答
  •  隐瞒了意图╮
    2020-12-03 05:58

    It is still possible to create more than one instance of the class, as follows:

    Singleton.getInstance().clone()
    

提交回复
热议问题