Pass a private variable to main() the right way?
<p>Here is my code:</p>

<pre><code>public class Test  {
    private static int NN;

    public Test (int N) {
       NN = N;
    }  

   public static void main(String[] args)  {
       Test t = new Test (N);
       int l = NN;
       for (i = 0; i &lt; l; i++) {
           // do my loop
       }
   }
}
</code></pre>

<p>What I want to do is get "N" from the constructor and pass it to a variable I can use in main() BUT:</p>

<p>a) if I do it this way I get a findbugs warning:</p>

<pre><code>M D ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD ST: Write to static field...
</code></pre>

<p>b) if I <em>don't</em> make "NN" static, it doesn't compile.</p>

<p>c) if I write a getter/setter for my private variable (NN) I break the api.</p>
