MCQ Practice Single Best Answer Topic: ICSE Computer Application - Class X - 2025 SPECIMEN QUESTION PAPER

Q The statement used to find the total number of Strings present in the string array String s[] is:

Question ID
#24270
Subchapter
ICSE Computer Application - Class X - 2025 SPECIMEN QUESTION PAPER
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A s.length
  • B s.length()
  • C length(s)
  • D len(s)
Correct Answer: A

Explanation

Let's carefully analyze:

We have a string array String s[]. We want the number of elements in the array.

  • (a) s.length → ✅ Correct. For arrays in Java, .length without parentheses gives the number of elements.

  • (b) s.length() → ❌ Incorrect. length() is used for String objects, not arrays.

  • (c) length(s) → ❌ Not valid in Java.

  • (d) len(s) → ❌ Python syntax, not Java.

Answer: (a) s.length

Share This Question

Share this MCQ with your friends or study group.