ICSE Class 10 Computer Applications Question 7 of 46

String Handling — Question 7

Back to all questions
7
Question

Question 2(vi)

Mention the purpose and syntax of equals() method.

Answer

The equals() method compares two strings to check whether they are equal or not. It checks the case of the character as well. The result is a boolean value true if they are equal, otherwise the result is false.
Syntax:
string1.equals(string2)