title: How to change a variable every iteration of a loop (Java)
body: <p>How can I have my variables change after every loop. I need the stated arraylist variables to go where the code is marked "HERE".</p>
  
  <pre><code>//variables i need to cycle through
  static ArrayList&lt;Integer&gt; one1,two1,one2,two2=new ArrayList&lt;&gt;();
  
  for(int i=0;i&lt;4;i++){
    for(int j=0;j&lt;word1[i].length();j++){
      if (word1[i].charAt(j)=='-'){
        HERE.add(j);
      } else if (word1[i].charAt(j)!='-') {
        HERE.add(null);
      }
    }
  }
  </code></pre>
  
  <p>Is there a simple way i could do this without dozens of lines of code?</p>