public class MyClass {
private static MyClass instance = null;
public synchronized static MyClass getInstance() {
if (instance == null) {
instance = new MyClass();
}
return instance;
}
public MyClass() {
super();
}
.
.
.
}
from external classes, this class can be accessed through
MyClass.getInstance()