What are the cons of creating static utility classes? The more I’ve made, the more I find them extremely useful. I understand that they lack object oriented design, but I still love them probably more than I should. Are there any other cons for their use?
Share
There is nothing wrong with them, in the right context. If you have free-standing, stateless methods (such as those found in
java.lang.Math), then a static class is the perfect place for them. The only reason they’re in a class at all is because Java has no concept of free-standing methods.