KnowledgeBoat Logo
|

Computer Applications

The number of bytes occupied by a character array of 10 elements.

  1. 20 bytes
  2. 60 bytes
  3. 40 bytes
  4. 120 bytes

Java Arrays

ICSE Sp 2024

54 Likes

Answer

20 bytes

Reason — A char data type occupies '2' bytes in the memory. Thus, 10 char type elements occupy (10 x 2) = 20 bytes in memory.

Answered By

28 Likes


Related Questions