According to Effective Java, item-1: Consider static factory methods instead of constructors. BorderFactory.createTitledBorder("")
is static factory method which has following advantages:
- 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.
For details descriptions, go through the Book.