Effective Java begins by talking about the drawbacks of constructors: they do not have names to distinguish each other, they have to create an instance of the object (and not use a cached object), they have to create an instance of the class (and not a subclass or a proxy for remote calls, access control, etc).
Share this post
Constructors are a bad idea
Share this post
Effective Java begins by talking about the drawbacks of constructors: they do not have names to distinguish each other, they have to create an instance of the object (and not use a cached object), they have to create an instance of the class (and not a subclass or a proxy for remote calls, access control, etc).