13 lines
297 B
Java
13 lines
297 B
Java
public class Singleton {
|
|
private Singleton() {
|
|
// Constructor code goes here.
|
|
}
|
|
|
|
private static class LazyHolder {
|
|
private static final Singleton INSTANCE = new Singleton();
|
|
}
|
|
|
|
public static Singleton getInstance() {
|
|
return LazyHolder.INSTANCE;
|
|
}
|
|
}
|