I have this type of array float[1][1][54][54]
. If it possible to cast this array to float[54][54]? Maybe it`s possible to remove two first empty dimensions?
Aleksej Dontnow
asked Feb 9, 2018 at 21:25
1 Answer 1
You can't cast it, but you can just assign the inner array to a new variable:
float[][][][] arr1 = new float[1][1][54][54];
float[][] arr2 = arr1[0][0];
Note that although they're separate variables, they actually share a reference to the same inner array, so they can't be modified separately.
answered Feb 9, 2018 at 21:30
lang-java