java - Static Variables on Properties File vs Singleton vs Static Class vs enum -


i have lot of static variables use in whole application like:

class a:  final static string a="a"; final static string b="b"; final static string c="c";  class b:  final static string a="a"; final static string b="b"; final static string e="e";  class c:  final static string a="a"; final static string c="c"; final static string f="f"; 

i don´t need change variables @ runtime.

so best opt here?

you can put these variables in interface. way, make these "public static final".

ideally can put these properties file. in case, these should config properties of application may control feature or could've been changed outside(e.g. url).


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -