1. 饿汉模式

public class Singleton {  
     private static Singleton instance = new Singleton();  
     private Singleton (){
     }
     public static Singleton getInstance() {  
     return instance;  
     }  
 }
View Code

相关文章:

  • 2021-12-08
  • 2022-01-15
猜你喜欢
  • 2022-02-23
  • 2021-10-29
  • 2022-12-23
  • 2021-10-03
  • 2021-11-22
  • 2022-02-18
相关资源
相似解决方案