What is wrong with the cast at second line?
<pre><code>Object arr = new int[]{1,2,3};
arr = (int[])arr; 

int someArr [] = (int[])arr;

for(int i:arr)  // compilation error
     System.out.println(i);

for(int i:someArr) //works fine
     System.out.println(i);
</code></pre>

<p>Why the cast at second line doesn't convert arr to an int array? I get a compilation error at line 4 which says "Can only iterate over an array or an instance of <code>java.lang.Iterable</code>". While debugging, at line 2, the variable snapshot shows arr with indexed values.</p>
