Computer Applications
For a multidimensional short array X[5][24], find the number of bytes required.
Java Arrays
2 Likes
Answer
The formula to calculate total number of bytes required by a two-dimensional array is as follows:
total bytes = number-of-rows x number-of-columns x size-of-base-type
= 5 x 24 x 2 (since short requires 2 bytes in memory)
= 240 bytes
Answered By
1 Like