title: Variable inside for loop is local, I want to make it public
body: <pre><code>if (a != 1 &amp;&amp; solone == (int)solone &amp;&amp; soltwo == (int)soltwo){
      // (lx+o)(mx+p)
      int h = (a*c);
      List&lt;Integer&gt; factors = new ArrayList&lt;Integer&gt;();
      for (int i = 1; i &lt; Math.sqrt(h); i++) {
          if (h % i == 0)
              factors.add(i);
      }
      Integer result = null;
      for (int ii: factors) {
          if (b == ii + h/ii){
              result = ii;
              // ax^2+hiix+iix+c
      }
      int hii = h/ii;
      int gcd1 = Euclid.getGcd(a, hii);
      int gcd2 = Euclid.getGcd(ii, c);
      String Factored = FactoredForm.getFF(gcd1, gcd2, a, hii);
  }
  </code></pre>
  
  <p>My String called Factored is one I need to use for printing later in my code. I can't use it because it doesn't recognize the variable outside of the for loop. How do I go about making it public? When i added public in front of the string, it said that only final is permitted? Also, I cannot simply move the extraneous code outside of the for loop because it all depends on the integer "ii" which is part of the loop. Help!</p>