Please refer below code and help me to understand why this not a valid singleton implementation.
class A{
private static A ob;
private A(){}
static {
ob = new A();
}
public static A getInstance() {
return ob;
}
}