Advertisements
Advertisements
प्रश्न
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.
पर्याय
(A) is true and (R) is false.
(A) is false and (R) is true.
Both (A) and (R) are true and (R) is the correct explanation of (A).
Both (A) and (R) are true, but (R) is not the correct explanation of (A).
MCQ
विधान आणि तर्क
Advertisements
उत्तर
(A) is false and (R) is true.
Explanation:
- (A) is false: String objects are immutable in Java, so the original string cannot be changed.
- (R) is true: The method can be used as
substring(beginIndex)orsubstring(beginIndex, endIndex)to extract a specific portion of a string.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2025-2026 (March) Official Board Paper
