title: Java - best practice for creating package-wide or global variables
body: <p>What is the standard approach/best practice to creating variables that are program- or package-wide in Java?</p>
  
  <p>I want to set up some global variables that are accessible by multiple classes. Examples of these global variables would be things like a boolean flag testModeOn, a language setting, current local server, time display format, etc. According to some other questions (namely <a href="https://stackoverflow.com/questions/4646577/global-variables-in-java#_=_">this one</a>) there aren't any global variables, but there are some work-arounds using interfaces (not recommended?) or classes. Since the original poster didn't explain their situation, they got nearly every answer under the sun and I want to ask specifically for program configuration variables.</p>
  
  <p>Is it better to create a class/package/interface and then import it into my working class/package? Is there anything I should be aware of when trying to implement these variables using a separate class or interface? Is there any other way to fudge package-level variables since Java apparently doesn't do this natively?</p>
  
  <p>NOTE: These variables would probably not change except when the program is re-compiled.</p>