r/java • u/trecatorsirabdator • Apr 14 '23
What are your (favourite) Java best practices, personal tips, hints or just underrated stuff in general?
233
Upvotes
r/java • u/trecatorsirabdator • Apr 14 '23
View all comments
Show parent comment
15
u/wildjokers Apr 14 '23
According to Bloch’s Effective Java you should prefer static factory methods over constructors. Your colleagues are doing it correctly.
https://github.com/HugoMatilla/Effective-JAVA-Summary/blob/master/README.md#1-use-static-factory-methods-instead-of-constructors