title: declaring long[] array in java
body: <p>Can anyone tell me why cant i declare array like this? </p>
  
  <pre><code>long[] powers = { 0, 0, 1, 7, 35, 155, 651, 2667, 10795, 43435,
                  174251, 698027, 2794155, 11180715, 44731051, 178940587,
                  715795115, 2863245995, 11453115051, 45812722347, 183251413675,
                  733006703275, 2932028910251, 11728119835307, 46912487729835,
                  187649967696555, 750599904340651, 3002399684471467};
  </code></pre>
  
  <p>Compiler says that the literal of type int is out of range. I also tried to to cast it to long like this </p>
  
  <pre><code>long[] powers = { 0, 0, 1, 7, 35, 155, 651, 2667, 10795, 43435,
                  174251, 698027, 2794155, 11180715, 44731051, 178940587,
                  715795115, (long)2863245995, (long)11453115051, (long)45812722347, etc ...
  </code></pre>
  
  <p>but nothing changed also tried someting like this <code>Long.valueOf(x)</code> where x is number whitch compiler has problem with. </p>
  
  <p>Any ideas? </p>
  
  <p>Thanks in advance </p>