Computer Applications

The number of bytes occupied by a character array of four rows and three columns are:

  1. 12
  2. 24
  3. 96
  4. 48

Values & Data Types Java

ICSE 2024

2 Likes

Answer

24

Reason — In Java, a character (char) takes 2 bytes because Java uses Unicode encoding.

Given:
Character Array: 4 rows and 3 columns
Total Elements = 4 × 3 = 12 characters

Memory Calculation:
Each character = 2 bytes
Total Memory = 12 × 2 = 24 bytes

Answered By

1 Like


Related Questions