MCPcopy Create free account
hub / github.com/TanaStudy/Java-Study / getInstance

Method getInstance

8. Demo/Java/src/main/Java/单例模式/Singleton.java:10–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8 }
9
10 public static Singleton getInstance(){
11 if(singleton == null){
12 synchronized (Singleton.class){
13 if(singleton == null){
14 singleton = new Singleton();
15 }
16 }
17 }
18 return singleton;
19 }
20
21 public static void main(String[] args) {
22 for(int i = 0; i < 100; i++){

Callers 15

runMethod · 0.95
generateValueMethod · 0.45
generateValueMethod · 0.45
getBeforeDateMethod · 0.45
getThisWeekStartTimeMethod · 0.45
getStartDayMethod · 0.45
getBeforeYearListMethod · 0.45
getTimeMethod · 0.45
getUserAgeMethod · 0.45
getTomorrowMethod · 0.45
getTodayTimeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected