2013-10-27 22:24:23 +00:00
|
|
|
public class Singleton {
|
|
|
|
|
private Singleton() {
|
|
|
|
|
// Constructor code goes here.
|
2013-04-11 01:07:29 -07:00
|
|
|
}
|
|
|
|
|
|
2013-10-27 22:24:23 +00:00
|
|
|
private static class LazyHolder {
|
|
|
|
|
private static final Singleton INSTANCE = new Singleton();
|
2013-04-11 01:07:29 -07:00
|
|
|
}
|
|
|
|
|
|
2013-10-27 22:24:23 +00:00
|
|
|
public static Singleton getInstance() {
|
|
|
|
|
return LazyHolder.INSTANCE;
|
|
|
|
|
}
|
2013-04-11 01:07:29 -07:00
|
|
|
}
|