Which of the following String methods results into boolean data type?

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

1(i)1 Mark · 2025 · Section A · 2025 Improvement

Which of the following String methods results into boolean data type?

Show SolutionHide Solution↓

equals()

Reason — In Java, the equals() method compares the contents of two strings and returns a boolean value (true or false), whereas trim(), replace(), and concat() return new strings, not boolean values.

Next question →

Browse the free Computer Applications sample bank