title: Going back to the first index after reaching the last one in an array
body: <p>After my array in the for loop reaches the last index, I get an exception saying that the index is out of bounds. What I wanted is for it to go back to the first index until <code>z</code> is equal to <code>ctr</code>. How can I do that?</p>
  
  <p>My code:</p>
  
  <pre><code>char res;
  int ctr = 10
  char[] flames = {'F','L','A','M','E','S'};
  
  for(int z = 0; z &lt; ctr-1; z++){
      res = (flames[z]);
      jLabel1.setText(String.valueOf(res));
  }
  </code></pre>