Assertion (A): The substring() method modifies the original String.

ICSE Class 10 Computer Applications PYQ · 2026 Paper · Section A

1(xix)1 Mark · 2026 · Section A · 2026 Paper

Assertion (A): The substring() method modifies the original String.

Reason (R): The substring() method can extract part of a String starting from a specific index.

Show SolutionHide Solution↓

(A) is false and (R) is true.

Reason — In Java, Strings are immutable, so the substring() method does not modify the original String, it returns a new String, making Assertion (A) false. However, the method does extract a part of the String starting from a specific index, which makes Reason (R) true.

← Previous questionNext question →

Browse the free Computer Applications sample bank