prevent creating instance of singleton from thread

Solutions on MaxInterview for prevent creating instance of singleton from thread by the best coders in the world

showing results for - "prevent creating instance of singleton from thread"
Geraldine
16 Aug 2018
1// for java
2// ** use 'synchronized' keyword in function declaration
3
4public static synchronized Database getInstance(){...}
5
similar questions