I have a class that consists only of static member variables and static methods. Essentially, it is serving as a general-purpose utility class.
Is i
Utility methods are often placed in classes with only static methods (like StringUtils
.) Global constants are also placed in their own class so that they can be imported by the rest of the code (public final static
attributes.)
Both uses are quite common and have private default constructors to prevent them from being instantiated. Declaring the class final prevents the mistake of trying to override static methods.
If by static member variables
you did not mean global constants, you might want to place the methods accessing those variables in a class of their own. In that case, could you eleborate on what those variables do in your code?