title: Why can array constants only be used in initializers?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong> <br/>
    <a href="https://stackoverflow.com/questions/6348479/arrays-constants-can-only-be-used-in-initializers-error">Arrays constants can only be used in initializers error</a></p>
  </blockquote>
  
  
  
  <p>I was studying arrays, and I came through this short-cut method of declaring and initializing an array in one line. For example,</p>
  
  <pre><code>int[] a = {1, 2, 3, 4, 5};
  </code></pre>
  
  <p>But when I tried to do following code, I got this compiler error saying "Array constants can only be used in initializer".</p>
  
  <pre><code>int[] a;
  a = {1, 2, 3, 4};
  </code></pre>
  
  <p>Why so?</p>