I have many classes with static final fields which are used as default values or config. What is best approach to create global config file? Should I move these fields to single
Both the approches are fine:
Have a static class with required final
fields.
Have a singelton but save it from multiple threads appropriately.
if possible use enum
over static fields. This way you can group related fields together.
If these are application level values, i'll prefer static
class over singelton.
and, you should decide if these are const values or configuration value that differ from time to time.