title: Assigning values of an array in a for loop java
body: <p>Im still starting out in java - and any guidance would be great on this. I'm basically hoping to create an array, then assign values to that array in a for loop. The code I have at the moment is:</p>
  
  <pre><code>int i;
  int[] testarray = new int[50];
  
  for (i = 0; i &lt;=50; i++) {  
  testarray[i]=i;
  }
  </code></pre>
  
  <p>All i wanna do is make an array with each entry the number of the iteration (using this method)
  I know its really simple, but I feel as if I have missed something important during learning the basics! 
  Thanks!</p>