I am working in an int[][][]
array and I need to return an address of one field of that array from a static function.
Given the fact that the dimensions of the Array will stay small (int[32][32][32]
) I had the idea to return one number containing all three Values, instead of using an Array containing the three numbers.
I already had a working solution, where i packed my number into a String and unpacked it in the receiving method via Integer.parseInt(String)
.
Unfortunately this didn't work quite, well in terms of runtime, so i thought of bitshifting.
I apologize for my bad english and hope this simple question is worth your time :)