I have encountered various classes that don't allow creation of their instance directly. Rather we have to create their instance from some other class's static method or it own static method. For example:
B b = A.getB();
or
B b = B.getInstance();
What reason is behind that?
Why don't they allow creating instance directly, as in:
B b = new B();