
738 Working with Strings
Explanation: In the above program, two string objects s1 and s2 are declared. Both the string
objects are initialized with the string “OOP.” The if statement checks whether the two strings
are identical or different. An appropriate message will be displayed on comparison. Thus, in
this program, the two string objects contain the same string, and, hence, it displays the message
“Both the strings are identical”.
18.4 RELATIONAL OPERATORS
Table 18.4 describes various relational operators. These operators can be used with string objects
for assignment, comparison, and so on. The following program illustrates the