I am going through Effective Java and some of my things which I
consider as standard are not suggested by the book, for instance
creation of object, I was under the impression that constructors
are the best way of doing it and books says we should make use
of static factory methods, I am not able to few some advantages
and so disadvantages and so am asking this question, here are
the benefits of using it. - One advantage of static factory
methods is that, unlike constructors, they have names. - A
second advantage of static factory methods is that, unlike
constructors, they are not required to create a new object each
time they’re invoked. - A third advantage of static factory
methods is that, unlike constructors, they can return an object
of any subtype of their return type. - A fourth advantage of
static factory methods is that they reduce the verbosity of
creating parameterized type instances. - The main disadvantage
of providing only static factory methods is that classes without
public or protected constr