Safe and efficient method to adapt static class for modification
<p>I'm adapting a simulation written in Java. My limited background is all in C++.</p>

<p>The current implementation of the simulation relies on a class called <code>Parameters</code>. An instance of class <code>Simulation</code> references attributes of <code>Parameters</code>, which I don't think is ever instantiated. The <code>Parameters</code> class has a structure like</p>

<pre><code>public class Parameters {
  public static int day = 0;
  public static final int endDay = 365;
  ....
  public static int getDate() {
    return day;
  }
}
</code></pre>

<p>In an instance of <code>Simulation</code>, there are references to, e.g., <code>Parameters.day</code>.</p>

<p>Currently, all the attributes of <code>Parameters</code> are hard-coded. I need to be able to change some of them with command-line arguments. For example, I'd like to be able to set a different <code>endDay</code> using a <code>Parameters::setEndDay(int customDay)</code> sort of function.</p>

<p>My first thought was to create an instance (<code>Parameters parameters = new Parameters()</code>) and completely rewrite the <code>Parameters</code> class so that all its attributes are private and only accessible through accessor functions. <b>I'm concerned that this approach is not very efficient.</b> Thus far, I have tried a hybrid approach in which I create an instance of the <code>Parameters</code> class, which I then pass to an instance of <code>Simulation</code> while still occasionally referencing <code>Parameters.day</code> (something I don't need to change). </p>

<p>One of the problems is that I don't have a good sense of class privileges in Java. </p>

<p>Suggestions appreciated.</p>
