Computer Applications

State the number of bytes and bits occupied by a character array of 20 elements.

Java Arrays

5 Likes

Answer

A char data type occupies 2 bytes in memory.

Total memory occupied by an array of 20 elements = 2 x 20 = 40 bytes.

Since 1 byte = 8 bits, memory occupied by an array of 20 elements = 40 x 8 = 320 bits.

Answered By

3 Likes


Related Questions