title: Why doesn't this for-each loop work?
body: <p>In this code, why isn't my array initialised as I want it to? Is the for-each loop not designed to do that, or am I just not using it correctly?</p>
  
  <pre><code>    int[] array = new int[5];
  
      //initialise array -&gt; Doesn't work! Array still full of 0's
      for(int i : array)
          i = 24;
  </code></pre>