Computer Applications

How many bytes are occupied by the below two-dimensional array?

1562015420
1302013020
16217.6716120
15817.515420
  1. 96 bytes
  2. 128 bytes
  3. 12 bytes
  4. 24 bytes

Java Arrays

2 Likes

Answer

128 bytes

Reason — The given table represents a 4×4 two-dimensional array (4 rows and 4 columns), which means there are 16 elements in total. The values include both integers and decimal numbers, indicating that the array is of double data type (which can store both whole numbers and decimal numbers).

In Java, a double occupies 8 bytes.
So, total bytes = 16 elements × 8 bytes = 128 bytes.

Answered By

3 Likes


Related Questions