title: How to give names to items in an array in java?
body: <p>I have created array of JFields;</p>
  
  <pre><code>JFields[] field = new JField[5];
  
  for(int j = 0; i &lt; 5; i++) {
      field[j] = new JField();
  }
  </code></pre>
  
  <p>What I want to do is give each item in the array a name, so for example, field1, field2, field3, field4, field5.</p>
  
  <p>I tried accomplishing that like this;</p>
  
  <pre><code>String[] field = {field1, field2, field3, field4, field5}
  </code></pre>
  
  <p>also tried doing it like this;</p>
  
  <pre><code>field[j] = {field1, field2, field3, field4, field5}
  </code></pre>
  
  <p>but neither work. Could someone tell me how I can do it, thanks.</p>
  
  <p>Also, how can I call individual items from that array</p>
  
  <p>I tried for example <code>field[0] OR field[1]</code> etc. but that doesn't work.</p>
  
  <p>Thanks </p>