Hello All..
check this out..
int a[][] = {{1,2}, null};
int b[][] = (int[][])a.clone();
a[0] == b[0] //Equal
a[0][1] == b[0][1] //Equal but sub-arrays are shared
a == b //Not Equal
Now..
int ai][] = {{1,2}, null};
long bi][] = (long[][])ai.clone();//Compiles!!! But ClassCast
My understanding was
Arrays are objects in
Java and they cant be casted implicitly/explcitily as the compiler will catch it
But how come in the second case it compiles???
Ragu