Consider the following array and answer the questions given below:

ICSE Class 10 Computer Applications PYQ · 2025 Improvement · Section A

2(ix)1 Mark · 2025 · Section A · 2025 Improvement

Consider the following array and answer the questions given below:

char ch [ ] = { ‘A’, ‘%’, ‘y’, ‘@’, ‘7’, ‘p’};

(a) How many bytes does the array occupy?

(b) What is the output of the statement Character.isDigit(ch[4])?

Show SolutionHide Solution↓

(a) In Java, each element of type char occupies 2 bytes of memory. The given array has 6 elements, therefore:

Total memory = 6 × 2 = 12 bytes.

(b)

true
  • The element ch[4] contains the character '7'.
  • The method Character.isDigit('7') returns true because '7' is a numeric digit.
← Previous questionNext question →

Browse the free Computer Applications sample bank