Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Which of these methods is used to compare two strings such that after comparison output returns different integer values as (0 for false, 1 for true)?

a) Equals ()
b) == operator
c) Compare()
d) None of the mentioned

Answer: c
Explanation: The comparison is case sensitive in nature and hence different integer values are returned for different conditions as under:
1. zero integer (0), if string s1 equal to string s2.
2. positive integer(+1), if string s1 greater than s2.
3. Negative integer(-1), if string s1 is less than s2.

Join The Discussion